Class: Async::Redis::Context::Nested
- Inherits:
-
Object
- Object
- Async::Redis::Context::Nested
- Defined in:
- lib/async/redis/context/nested.rb
Instance Method Summary collapse
- #call(command, *args) ⇒ Object
- #close ⇒ Object
-
#initialize(pool, *args) ⇒ Nested
constructor
A new instance of Nested.
Constructor Details
#initialize(pool, *args) ⇒ Nested
Returns a new instance of Nested.
26 27 28 29 |
# File 'lib/async/redis/context/nested.rb', line 26 def initialize(pool, *args) @pool = pool @connection = pool.acquire end |
Instance Method Details
#call(command, *args) ⇒ Object
38 39 40 41 |
# File 'lib/async/redis/context/nested.rb', line 38 def call(command, *args) @connection.write_request([command, *args]) return @connection.read_response end |
#close ⇒ Object
31 32 33 34 35 36 |
# File 'lib/async/redis/context/nested.rb', line 31 def close if @connection @pool.release(@connection) @connection = nil end end |