Class: Async::Redis::Context::Multi
- Defined in:
- lib/async/redis/context/multi.rb
Instance Method Summary collapse
- #discard ⇒ Object
- #execute ⇒ Object
- #get(key) ⇒ Object
-
#initialize(pool, *args) ⇒ Multi
constructor
A new instance of Multi.
- #set(key, value) ⇒ Object
Methods inherited from Nested
Constructor Details
#initialize(pool, *args) ⇒ Multi
Returns a new instance of Multi.
28 29 30 31 32 33 |
# File 'lib/async/redis/context/multi.rb', line 28 def initialize(pool, *args) super(pool) @connection.write_request(['MULTI']) @connection.read_response end |
Instance Method Details
#discard ⇒ Object
47 48 49 |
# File 'lib/async/redis/context/multi.rb', line 47 def discard return send_command 'DISCARD' end |
#execute ⇒ Object
43 44 45 |
# File 'lib/async/redis/context/multi.rb', line 43 def execute return send_command 'EXEC' end |
#get(key) ⇒ Object
39 40 41 |
# File 'lib/async/redis/context/multi.rb', line 39 def get(key) return send_command 'GET', key end |
#set(key, value) ⇒ Object
35 36 37 |
# File 'lib/async/redis/context/multi.rb', line 35 def set(key, value) return send_command('SET', key, value) end |