Class: Redis::Pooled
- Inherits:
-
Object
- Object
- Redis::Pooled
- Includes:
- Pools::Pooled
- Defined in:
- lib/redis/pooled.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Pools::Pooled
#connection_pool, #preparation_chain
Instance Method Summary collapse
- #__connection ⇒ Object
- #__disconnect(client) ⇒ Object
-
#initialize(options = {}) ⇒ Pooled
constructor
A new instance of Pooled.
Methods included from Pools::Pooled
Constructor Details
#initialize(options = {}) ⇒ Pooled
Returns a new instance of Pooled.
8 9 10 11 |
# File 'lib/redis/pooled.rb', line 8 def initialize( = {}) @redis_options = super end |
Instance Method Details
#__connection ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/redis/pooled.rb', line 13 def __connection if Redis.respond_to?(:connect) # 3.x and earlier Redis.connect(@redis_options) else Redis.new(@redis_options) end end |
#__disconnect(client) ⇒ Object
21 22 23 |
# File 'lib/redis/pooled.rb', line 21 def __disconnect(client) client.quit if client end |