Class: Queight::ConnectionCache

Inherits:
Object
  • Object
show all
Defined in:
lib/queight/connection_cache.rb

Instance Method Summary collapse

Constructor Details

#initializeConnectionCache

Returns a new instance of ConnectionCache.



5
6
7
# File 'lib/queight/connection_cache.rb', line 5

def initialize
  @cache ||= {}
end

Instance Method Details

#call(options) ⇒ Object



13
14
15
# File 'lib/queight/connection_cache.rb', line 13

def call(options)
  @cache[options] ||= ChannelPool.new(options)
end

#reset_cache!Object



9
10
11
# File 'lib/queight/connection_cache.rb', line 9

def reset_cache!
  @cache.values.each(&:reset_cache!)
end