Class: Async::Redis::Context::Nested
- Inherits:
-
Object
- Object
- Async::Redis::Context::Nested
- Includes:
- Methods::Keys, Methods::Lists, Methods::Strings
- 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.
Methods included from Methods::Lists
#blpop, #brpop, #brpoplpush, #lindex, #linsert, #llen, #lpop, #lpush, #lpushx, #lrange, #lrem, #lset, #ltrim, #rpop, #rpoplpush, #rpush, #rpushx
Methods included from Methods::Keys
#del, #dump, #exists, #expire, #expireat, #keys, #migrate, #move, #object, #persist, #pexpire, #pexpireat, #pttl, #randomkey, #rename, #renamenx, #restore, #scan, #sort, #touch, #ttl, #type, #unlink, #wait
Methods included from Methods::Strings
#append, #bitcount, #decr, #decrby, #get, #getbit, #getrange, #getset, #incr, #incrby, #incrbyfloat, #mget, #mset, #msetnx, #psetex, #set, #setbit, #setex, #setnx, #setrange, #strlen
Constructor Details
#initialize(pool, *args) ⇒ Nested
Returns a new instance of Nested.
34 35 36 37 |
# File 'lib/async/redis/context/nested.rb', line 34 def initialize(pool, *args) @pool = pool @connection = pool.acquire end |
Instance Method Details
#call(command, *args) ⇒ Object
46 47 48 49 |
# File 'lib/async/redis/context/nested.rb', line 46 def call(command, *args) @connection.write_request([command, *args]) return @connection.read_response end |
#close ⇒ Object
39 40 41 42 43 44 |
# File 'lib/async/redis/context/nested.rb', line 39 def close if @connection @pool.release(@connection) @connection = nil end end |