parallel-functions/examples/2-echo.php
2019-01-07 18:14:31 -06:00

11 lines
371 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;
// All output in the parallel environment is redirected to STDOUT/STDERR of the parent process automatically.
// You might notice that the output order varies here when running it multiple times.
wait(parallelMap([1, 2, 3], 'var_dump'));