Download the PHP package steevanb/php-parallel-processes without Composer
On this page you can find all versions of the php package steevanb/php-parallel-processes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download steevanb/php-parallel-processes
More information about steevanb/php-parallel-processes
Files in steevanb/php-parallel-processes
Package php-parallel-processes
Short Description Call processes in parallel
License Apache-2.0
Informations about the package php-parallel-processes
php-parallel-processes
Execute processes in parallel.
Examples of use: start your environment, CI tools...
Installation
Use official Docker image
You can use the official Docker image to not install anything: steevanb/php-parallel-processes:x.y.z.
Example:
If your processes use docker
If processes in parallel-processes.php use Docker, you have to add a volume on your Docker socket:
All official php-parallel-processes images have Docker and Docker compose installed, so you only need to add a volume on the socket.
alpine, bookworm and buster
3 Docker images are provided for each php-parallel-processes version, use the one you want depending on your needs:
alpine: smaller version, but could be "too much simple" sometimesbuster: middle version, contains almost everything neededbookworm: larger version, should contain what you need
Install as Composer dependency
If you want to add php-parallel-processes directly in your project:
Create processes configuration
You need to create a configuration for your processes, written in PHP.
Example: bin/start.php
Basic example
Configurations
Global timeout
You can configure the global timeout with ParallelProcessesApplication::setTimeout().
Default value: null (no timeout).
Refresh interval
You can configure the refresh interval, to scan all processes status and start the next ones,
with ParallelProcessesApplication::setRefreshInterval().
Default value: 10000 (10ms)
Maximum processes in parallel
You can configure the maximum number of processes in parallel
with ParallelProcessesApplication::setMaximumParallelProcesses().
Default value: null (no maximum)
Theme
php-parallel-processes comes with 2 themes:
- default
- Output everything
- Use verbosity (
-v,-vvor-vvv) to add execution time and process outputs - Should be used when you need to see live processes status, most of the time ;)
- summary
- Output only the start and the end of parallel processes
- Use verbosity (
-v,-vvor-vvv) to add execution time and process outputs - Should be used when you don't need to see live processes status, in CI for example
Configure it with ParallelProcessesApplication::setTheme():
You can also configure it in CLI with --theme (CLI override PHP configuration):
You can create your own theme by implementing ThemeInterface.
All versions of php-parallel-processes with dependencies
ext-pcntl Version *
steevanb/php-collection Version ^6.0
symfony/console Version ^7.0 || ^8.0
symfony/process Version 7.0.0 || >=7.1.5 <8.0.0 || ^8.0