Class: RedisClient::Cluster::PubSub
- Inherits:
-
Object
- Object
- RedisClient::Cluster::PubSub
- Defined in:
- lib/redis_client/cluster.rb
Instance Method Summary collapse
- #call(*command, **kwargs) ⇒ Object
- #close ⇒ Object
-
#initialize(client) ⇒ PubSub
constructor
A new instance of PubSub.
- #next_event(timeout = nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ PubSub
Returns a new instance of PubSub.
71 72 73 74 |
# File 'lib/redis_client/cluster.rb', line 71 def initialize(client) @client = client @pubsub = nil end |
Instance Method Details
#call(*command, **kwargs) ⇒ Object
76 77 78 79 80 |
# File 'lib/redis_client/cluster.rb', line 76 def call(*command, **kwargs) close @pubsub = @client.send(:assign_node, *command).pubsub @pubsub.call(*command, **kwargs) end |
#close ⇒ Object
82 83 84 85 |
# File 'lib/redis_client/cluster.rb', line 82 def close @pubsub&.close @pubsub = nil end |
#next_event(timeout = nil) ⇒ Object
87 88 89 |
# File 'lib/redis_client/cluster.rb', line 87 def next_event(timeout = nil) @pubsub&.next_event(timeout) end |