Class: ParallelWorkforce::RedisConnector::RedisPool

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_workforce/redis_connector/redis_pool.rb

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (redis)


4
5
6
7
8
# File 'lib/parallel_workforce/redis_connector/redis_pool.rb', line 4

def with(&block)
  redis = (Thread.current["#{self.class.name}:redis_connection"] ||= Redis.new)

  yield(redis)
end