Skip to content

Getting Multiple errors encountered; use Amp\MultiReasonException::getReasons()  #32

@jaydp

Description

@jaydp

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions