Class: Conflow::Redis::ConnectionWrapper Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Wraps Redis connection to behave like connection pool

Instance Method Summary collapse

Constructor Details

#initialize(redis) ⇒ ConnectionWrapper

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ConnectionWrapper.

Parameters:

  • redis (Redis)

    Redis connection to be wrapped



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

def initialize(redis)
  @redis = redis
end

Instance Method Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Allows accessing Redis connection

Yield Parameters:

  • redis (Redis)

    connection



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

def with
  yield @redis
end