-
-
Notifications
You must be signed in to change notification settings - Fork 18
Description
When I tried to run following code then it works fine
$values = Promise\wait(parallelMapAlias([5,6], function ($string) { return $string * $string; })); print_r($values);
give me output
Array ( [0] => 25 [1] => 36 )
But when I add more array to argument then give me following error
Sample Code: (Added 7)
$values = Promise\wait(parallelMapAlias([5,6,7], function ($string) { return $string * $string; })); print_r($values);
Error:
PHP Fatal error: Uncaught Amp\MultiReasonException: Multiple errors encountered; use Amp\MultiReasonException::getReasons() to retrieve the array of exceptions thrown in /WebProjects/example/amp/vendor/amphp/parallel-functions/src/functions.php:59 Stack trace: #0 [internal function]: Amp\ParallelFunctions\{closure}() #1 /WebProjects/example/amp/vendor/amphp/amp/lib/Coroutine.php(118): Generator->send() #2 /WebProjects/example/amp/vendor/amphp/amp/lib/Internal/Placeholder.php(149): Amp\Coroutine->Amp\{closure}() #3 /WebProjects/example/amp/vendor/amphp/amp/lib/Deferred.php(53): class@anonymous->resolve() #4 /WebProjects/example/amp/vendor/amphp/amp/lib/functions.php(546): Amp\Deferred->resolve() #5 /WebProjects/example/amp/vendor/amphp/amp/lib/Internal/ResolutionQueue.php(70): Amp\Promise\{closure}() #6 /WebProjects/example/amp/vendor/amphp/amp/lib/Failure.php(33): Amp\Internal\ResolutionQueue->__invoke() #7 /WebProjects/example/amp/vendor/amphp/amp/lib/Internal/Placeholder.php(143): Amp\Failure->onResolve() #8 /WebProjects/ex in /WebProjects/example/amp/vendor/amphp/parallel-functions/src/functions.php on line 59
REF From :
https://amphp.org/parallel-functions/