1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Add note about yielding an array === Amp\Promise\all

This commit is contained in:
Niklas Keller 2017-07-12 23:48:48 +02:00
parent a976a73cbc
commit acd79411b4

View File

@ -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);