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();