Method: Xunch::FiberRedisPool#initialize

Defined in:
lib/xunch/connection/fiber_redis_pool.rb

#initialize(options) ⇒ FiberRedisPool

Returns a new instance of FiberRedisPool.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/xunch/connection/fiber_redis_pool.rb', line 4

def initialize(options)
  @reserved  = {}   # map of in-progress connections
  @available = []   # pool of free connections
  @pending   = []   # pending reservations (FIFO)
  @pool_timeout = options[:pool_timeout]

  options[:size].times do
    @available.push(redis = Redis.new(options))
  end

  @closed = false
end