Explorar o código

Reduce overhead by directly managing reply handlers for multibulk replies.

Daniele Alessandri %!s(int64=14) %!d(string=hai) anos
pai
achega
db92c7a9b8
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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));
             }
         }