parallel-functions/examples/3-return-value.php

10 lines
289 B
PHP
Raw Permalink 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;
// We have seen that the order can vary in the previous example, values returned have a deterministic order.
2022-02-02 23:04:43 +01:00
var_dump(wait(parallelMap([1, 2, 3], 'abs')));