diff --git a/src/Transport/HttpTransport.php b/src/Transport/HttpTransport.php index 292de04..b634985 100644 --- a/src/Transport/HttpTransport.php +++ b/src/Transport/HttpTransport.php @@ -171,7 +171,7 @@ public function read(array $queries, int $concurrency = 5) : array $openedStreams = []; $requests = function ($queries) use(&$openedStreams) { - foreach ($queries as $query) { + foreach ($queries as $index => $query) { /* @var Query $query */ $params = [ @@ -205,7 +205,7 @@ public function read(array $queries, int $concurrency = 5) : array $uri = $this->buildRequestUri($query->getServer(), $params); - yield new Request('POST', $uri, [], $body); + yield $index => new Request('POST', $uri, [], $body); } };