co-stack/process-manager

Simple wrapper to enable parallel processing using Symfony Process component

v3.2.1 2024-09-25 12:24 UTC

This package is auto-updated.

Last update: 2024-10-25 10:39:03 UTC


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.