Class: Async::Redis::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/nchan_tools/rdsck.rb

Instance Method Summary collapse

Instance Method Details

#psubscribe(*channels) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/nchan_tools/rdsck.rb', line 27

def psubscribe(*channels)                                                                                                                                             
  context = Async::Redis::Context::Psubscribe.new(@pool, channels)                                                                                                            
  return context unless block_given?                                                                                                                           
  begin                                                                                                                                                        
    yield context                                                                                                                                        
  ensure                                                                                                                                                       
    context.close                                                                                                                                        
  end                                                                                                                                                          
end