Class: Async::Redis::Context::Subscribe

Inherits:
Generic
  • Object
show all
Defined in:
lib/async/redis/context/subscribe.rb

Instance Method Summary collapse

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

#listenObject



36
37
38
# File 'lib/async/redis/context/subscribe.rb', line 36

def listen
	return @connection.read_response
end