Download the PHP package riki137/multitron without Composer
On this page you can find all versions of the php package riki137/multitron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download riki137/multitron
More information about riki137/multitron
Files in riki137/multitron
Package multitron
Short Description Tool for managing fast both asynchronous and multi-threaded execution of tasks. Focused on performance and pleasant CLI interface.
License MIT
Informations about the package multitron
Multitron: High-Performance PHP Task Orchestrator
Multitron is a powerful, high-performance PHP task orchestrator designed to simplify parallel processing, concurrency, and automation in PHP applications. Quickly execute complex tasks asynchronously, maximizing the efficiency and scalability of your workflows.
Ideal for Symfony Console apps, CI/CD pipelines, batch processing, and heavy PHP workloads.
Why Choose Multitron?
- 🔄 Efficient Task Dependency Management: Clearly define task dependencies with intuitive declarative syntax.
- ⚡ Optimized Parallel Execution: Automatic CPU core detection for peak performance and resource utilization.
- 🧩 Partitioned Workloads: Easily split large tasks across multiple worker processes.
- 📊 Real-Time Progress & Transparency: Continuous console logging and progress tracking.
- 🗄️ Centralized Cache for Tasks: Inter-process data sharing and communication made simple.
- 🔌 Symfony Console Ready: Effortlessly integrate Multitron into your existing Symfony-based applications.
- 📄 Open Source & MIT Licensed: Completely free to use, adapt, and distribute.
Installation
- Symfony Integration
- Laravel Integration
- Native PHP Integration
- Nette Integration
Usage
Tasks implement the Multitron\Execution\Task
interface. Here's a minimal example task:
You can register tasks in a command that extends Multitron\Console\AbstractMultitronCommand
:
Register the command in your Symfony Console application and run it. Multitron will execute the tasks respecting dependencies and concurrency.
You can control how many tasks run at once via the -c
/--concurrency
option:
The library will spawn up to eight worker processes and keep them busy until all tasks finish.
To limit which tasks run, pass a pattern as the first argument. Wildcards work the same as in fnmatch()
and you may use %
in place of *
for convenience:
You can also tune how often progress updates are rendered using the -u
/--update-interval
option (in seconds):
You may also constrain memory usage with the -m
/--memory-limit
option:
You can disable colors with --no-colors
and switch off interactive table rendering using --interactive=no
. The default --interactive=detect
automatically falls back to plain output when run in CI.
Central Cache
Within a task you receive a TaskCommunicator
instance that provides simple methods to read and write data shared between tasks:
Reporting Progress
Tasks can update progress counters that Multitron displays while running. Use
the ProgressClient
provided by the communicator:
You may also call addOccurrence()
or addWarning()
to report additional
metrics or warnings.
Partitioned Tasks
When a workload can be split into chunks, partitioned tasks run those chunks in parallel. Define a task extending PartitionedTask
and specify the number of partitions in the tree:
Accessing CLI Options
Options passed on the command line are forwarded to each task. Retrieve them via
TaskCommunicator
:
Call getOptions()
to receive the entire array of options if needed.
Custom Progress Output
Multitron renders progress using a ProgressOutputFactory
. Replace the default table display or combine outputs with ChainProgressOutputFactory
:
Implement the factory to send progress anywhere you like.
Contribute to Multitron!
Your feedback, issues, and contributions are highly encouraged. Open a GitHub issue or start a pull request to help improve PHP concurrency and task management:
License
Multitron is MIT licensed. See the LICENSE file for full details.
SEO Keywords: PHP Task Orchestrator, Parallel Processing PHP, Symfony CLI Automation, Asynchronous PHP Tasks, Multitron PHP, PHP Concurrency, PHP Task Manager, Open-source PHP Library
All versions of multitron with dependencies
ext-pcntl Version *
ext-mbstring Version *
symfony/console Version ^7.2
riki137/stream-ipc Version ^1.0.0-beta6
psr/container Version ^2.0
psr/container-implementation Version *