From 92ca8f8e7102fe920e21c5ee0e1ac8fb2ae31d65 Mon Sep 17 00:00:00 2001 From: evsign Date: Fri, 23 Nov 2018 19:32:36 +0300 Subject: [PATCH] fix async read with string keys --- src/Transport/HttpTransport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } };