Run multiple Synfony\Process's at the same time.
Via Composer
$ composer require graze/parallel-process$failure = function (Process $process, $duration) {
throw new ProcessFailureException($process);
}
$pool = new Pool();
$pool->setOnFailure($failure);
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->add(new Process('sleep 100'));
$pool->run(); // blocking that will run till it finishesVisual output of the parallel processes
Requires: graze/console-diff-renderer
$table = new Table($output);
for ($i = 0; $i < 5; $i++) {
$time = $i + 5;
$table->add(new Process(sprintf('for i in `seq 1 %d` ; do date ; sleep 1 ; done', $time)), ['sleep' => $time]);
}
$table->run();$ make testPlease see CONTRIBUTING for details.
If you discover any security related issues, please email security@graze.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.