Ver código fonte

Enhancement: set how to handle multibulk replies (fetch the whole reply or stream it down to the user code).

Daniele Alessandri 15 anos atrás
pai
commit
c281891641
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      lib/Predis.php

+ 7 - 0
lib/Predis.php

@@ -400,6 +400,13 @@ class ResponseReader {
 
     public function setOption($option, $value) {
         switch ($option) {
+            case 'iterable_multibulk_replies':
+            case 'iterableMultiBulkReplies':
+                $this->setHandler('*', $value == true 
+                    ? new ResponseMultiBulkStreamHandler()
+                    : new ResponseMultiBulkHandler()
+                );
+                break;
             default:
                 throw new \InvalidArgumentException("Unknown option: $option");
         }