Module: Stealth::RedisSupport

Defined in:
lib/stealth/redis.rb

Class Method Summary collapse

Class Method Details

.configObject



23
24
25
# File 'lib/stealth/redis.rb', line 23

def config
  @config ||= RedisConfig.new
end

.configure {|config| ... } ⇒ Object

Yields:



27
28
29
30
# File 'lib/stealth/redis.rb', line 27

def configure
  yield(config)
  reset_pool!
end

.connection_poolObject



40
41
42
# File 'lib/stealth/redis.rb', line 40

def connection_pool
  pool
end

.poolObject



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