parallel-functions/examples/3-return-value.php
2017-12-13 23:48:03 +01:00

10 lines
290 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;
// We have seen that the order can vary in the previous example, values returned have a deterministic order.
\var_dump(wait(parallelMap([1, 2, 3], 'abs')));