Browse Source

Reduce overhead by directly managing reply handlers for multibulk replies.

Daniele Alessandri 14 năm trước cách đây
mục cha
commit
db92c7a9b8
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      lib/Predis.php

+ 3 - 1
lib/Predis.php

@@ -611,7 +611,9 @@ class ResponseMultiBulkHandler implements IResponseHandler {
         if ($listLength > 0) {
             $reader = $connection->getResponseReader();
             for ($i = 0; $i < $listLength; $i++) {
-                $list[$i] = $reader->read($connection);
+                $header = $connection->readLine();
+                $handler = $reader->getHandler($header[0]);
+                $list[$i] = $handler->handle($connection, substr($header, 1));
             }
         }