parallel-functions/examples/2-echo.php

11 lines
364 B
PHP
Raw Normal View History

2017-12-13 22:58:26 +01:00
<?php
require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelFunctions\parallelMap;
2017-12-13 22:58:26 +01:00
use function Amp\Promise\wait;
2017-12-13 22:58:26 +01:00
// All output in the parallel environment is redirected to 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'));