Class: Async::Redis::Context::Subscribe
- Defined in:
- lib/async/redis/context/subscribe.rb
Instance Method Summary collapse
-
#initialize(pool, channels) ⇒ Subscribe
constructor
A new instance of Subscribe.
- #listen ⇒ Object
Methods inherited from Generic
#call, #close, #read_response, #write_request
Constructor Details
#initialize(pool, channels) ⇒ Subscribe
Returns a new instance of Subscribe.
28 29 30 31 32 33 34 |
# File 'lib/async/redis/context/subscribe.rb', line 28 def initialize(pool, channels) super(pool) @channels = channels subscribe(channels) end |
Instance Method Details
#listen ⇒ Object
36 37 38 |
# File 'lib/async/redis/context/subscribe.rb', line 36 def listen return @connection.read_response end |