Class: Conflow::Redis::ConnectionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/conflow/redis/connection_wrapper.rb

Overview

Wraps Redis connection to behave like connection pool

Instance Method Summary collapse

Constructor Details

#initialize(redis) ⇒ ConnectionWrapper

Returns a new instance of ConnectionWrapper.

Parameters:

  • redis (Redis)

    Redis connection to be wrapped



8
9
10
# File 'lib/conflow/redis/connection_wrapper.rb', line 8

def initialize(redis)
  @redis = redis
end

Instance Method Details

#with {|redis| ... } ⇒ Object

Allows accessing Redis connection

Yield Parameters:

  • redis (Redis)

    connection



14
15
16
# File 'lib/conflow/redis/connection_wrapper.rb', line 14

def with
  yield @redis
end