andersondanilo/process-pool

v2.0.1 2021-02-14 13:39 UTC

This package is auto-updated.

Last update: 2024-10-15 00:13:20 UTC


README

Latest Version Total Downloads CI

PHP Process Pool is a simple process pool using symfony process

use ProcessPool\ProcessPool;
use Symfony\Component\Process\Process;

function processGenerator($count) {
    for ($i = 0; $i < 10; $i++) {
        yield new Process(['sleep', $i]);
    }
}

$processes = processGenerator(10);
$pool = new ProcessPool($processes);
$pool->setConcurrency(2);
$pool->wait();