Class: CountingSemaphore::RedisSemaphore::NullPool
- Inherits:
-
Object
- Object
- CountingSemaphore::RedisSemaphore::NullPool
- Defined in:
- lib/counting_semaphore/redis_semaphore.rb
Overview
Null pool for bare Redis connections that don't need connection pooling. Provides a compatible interface with ConnectionPool for bare Redis instances.
Instance Method Summary collapse
-
#initialize(redis_connection) ⇒ NullPool
constructor
Creates a new NullPool wrapper around a Redis connection.
-
#with {|redis| ... } ⇒ Object
Yields the wrapped Redis connection to the block.
Constructor Details
#initialize(redis_connection) ⇒ NullPool
Creates a new NullPool wrapper around a Redis connection.
163 164 165 |
# File 'lib/counting_semaphore/redis_semaphore.rb', line 163 def initialize(redis_connection) @redis_connection = redis_connection end |
Instance Method Details
#with {|redis| ... } ⇒ Object
Yields the wrapped Redis connection to the block. Provides ConnectionPool-compatible interface.
172 173 174 |
# File 'lib/counting_semaphore/redis_semaphore.rb', line 172 def with(&block) block.call(@redis_connection) end |