Class: Esse::RedisStorage::Pool

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/esse/redis_storage/pool.rb

Defined Under Namespace

Modules: ConnectionPoolLike

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Pool

Returns a new instance of Pool.



15
16
17
18
19
20
21
22
# File 'lib/esse/redis_storage/pool.rb', line 15

def initialize(connection)
  if connection.respond_to?(:with)
    @connection = connection
  else
    @connection = connection ? ::Redis.new(connection) : ::Redis.new
    @connection.extend(ConnectionPoolLike)
  end
end