PHP code example of jagandecapri / symfony-parallel-process

1. Go to this page and download the library: Download jagandecapri/symfony-parallel-process library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jagandecapri / symfony-parallel-process example snippets




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