Explorar o código

Expose underlying client object from pub/sub iterators.

Daniele Alessandri %!s(int64=12) %!d(string=hai) anos
pai
achega
8451146d38
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      lib/Predis/PubSub/PubSubContext.php

+ 10 - 0
lib/Predis/PubSub/PubSubContext.php

@@ -41,6 +41,16 @@ class PubSubContext extends AbstractPubSubContext
         $this->genericSubscribeInit('psubscribe');
     }
 
+    /**
+     * Returns the underlying client instance used by the pub/sub iterator.
+     *
+     * @return ClientInterface
+     */
+    public function getClient()
+    {
+        return $this->client;
+    }
+
     /**
      * Checks if the passed client instance satisfies the required conditions
      * needed to initialize a Publish / Subscribe context.