PHP code example of ptachoire / parallelizer

1. Go to this page and download the library: Download ptachoire/parallelizer 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/ */

    

ptachoire / parallelizer example snippets


use Parallelizer\Parallelizer;

// we want to run 2 processes in parallel
$parallelizer = new Parallelizer(2);

$parallelizer->add($processA, 'processA');
$parallelizer->add($processB, 'processB');
// ....

var_dump($parallelizer->run());