kissifrot/symfony-parallel-process

Simple wrapper to enable parallel processing using Symfony Process component

v2.4.0 2024-06-20 11:53 UTC

This package is auto-updated.

Last update: 2024-11-20 12:51:41 UTC


README

A simple wrapper to enable parallel processing using Symfony Process component.

Fork of jagandecapri/symfony-parallel-process

Installation

composer require kissifrot/symfony-parallel-process

Example

<?php

use Symfony\Component\Process\Process;
use Jack\Symfony\ProcessManager;

$proc1 = new Process('ls -l');
$proc2 = new Process('ls -l');

$proc_mgr = new ProcessManager();

$processes = array();
array_push($processes, $proc1, $proc2);

$max_parallel_processes = 5;
$polling_interval = 1000; // microseconds
$proc_mgr->runParallel($processes, $max_parallel_processes, $polling_interval);