Closed isaac-gilmour-asknicely closed 2 years ago
Description Currently, \GuzzleHttp\Promise\Utils::settle mangles the order of the responses returned. I propose the removal of ksort($results) to persist the order of the responses
\GuzzleHttp\Promise\Utils::settle
ksort($results)
Example
$client = new Client(); $promises = [ 'd' => $client->getAsync('https://example.com'), 'c' => $client->getAsync('https://example.com'), 'b' => $client->getAsync('https://example.com'), 'a' => $client->getAsync('https://example.com'), ]; $responses = Utils::settle($promises)->wait(); foreach ($responses as $key => $result) { echo "$key\n"; }
Current output:
a b c d
Expected output:
d c b a
This is intentional. They are yielded in the order they completed.
Description Currently,
\GuzzleHttp\Promise\Utils::settle
mangles the order of the responses returned. I propose the removal ofksort($results)
to persist the order of the responsesExample
Current output:
Expected output: