Module: Stealth::RedisSupport
- Defined in:
- lib/stealth/redis.rb
Class Method Summary collapse
- .config ⇒ Object
- .configure {|config| ... } ⇒ Object
- .connection_pool ⇒ Object
- .pool ⇒ Object
- .reset_pool! ⇒ Object
- .with(&blk) ⇒ Object
Class Method Details
.config ⇒ Object
23 24 25 |
# File 'lib/stealth/redis.rb', line 23 def config @config ||= RedisConfig.new end |
.configure {|config| ... } ⇒ Object
27 28 29 30 |
# File 'lib/stealth/redis.rb', line 27 def configure yield(config) reset_pool! end |
.connection_pool ⇒ Object
40 41 42 |
# File 'lib/stealth/redis.rb', line 40 def connection_pool pool end |
.pool ⇒ Object
32 33 34 |
# File 'lib/stealth/redis.rb', line 32 def pool @pool ||= build_pool end |
.reset_pool! ⇒ Object
44 45 46 47 48 49 |
# File 'lib/stealth/redis.rb', line 44 def reset_pool! if defined?(@pool) && @pool @pool.shutdown(&:close) rescue nil end @pool = nil end |
.with(&blk) ⇒ Object
36 37 38 |
# File 'lib/stealth/redis.rb', line 36 def with(&blk) pool.with(&blk) end |