co-stack / process-manager
Simple wrapper to enable parallel processing using Symfony Process component
v3.2.1
2024-09-25 12:24 UTC
Requires
- php: ^7.4 || ^8.0
- symfony/process: ^5.4 || ^6.3 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.6 || ^10.4
README
A simple wrapper to enable parallel processing using Symfony Process component.
Installation
composer require co-stack/process-manager
Example
<?php
use CoStack\ProcessManager\ProcessManager;
use Symfony\Component\Process\Process;
$proc1 = new Process(['ls', '-l']);
$proc2 = new Process(['ls', '-l']);
$processmanager = new ProcessManager();
$processes = [
$proc1,
$proc2,
];
$maxParallelProcesses = 5;
// microseconds
$pollingInterval = 1000;
$processmanager->runParallel($processes, $maxParallelProcesses, $pollingInterval);
Other
This is a fork of jagandecapri/symfony-parallel-process where I contributed to in 2016. Since that, the repo was not maintained, so I decided to take over and update it.