mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Add note about yielding an array === Amp\Promise\all
This commit is contained in:
parent
a976a73cbc
commit
acd79411b4
@ -33,7 +33,8 @@ Loop::run(function () {
|
||||
|
||||
try {
|
||||
// magic combinator sauce to flatten the promise
|
||||
// array into a single promise
|
||||
// array into a single promise.
|
||||
// yielding an array is an implicit "yield Amp\Promise\all($array)".
|
||||
$responses = yield array_map(function ($uri) use ($httpClient) {
|
||||
return $httpClient->request($uri);
|
||||
}, $uris);
|
||||
|
Loading…
Reference in New Issue
Block a user