gemorroj/process-pool

dev-master 2024-07-27 11:56 UTC

This package is auto-updated.

Last update: 2024-10-27 12:33:45 UTC


README

License Latest Stable Version Continuous Integration

PHP Process Pool is a simple process pool using Symfony Process

System requirements:

  • PHP >= 8.2
  • proc_open

Installation:

composer require gemorroj/process-pool

Example:

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

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

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