Class: Async::Redis::Context::Multi

Inherits:
Nested
  • Object
show all
Defined in:
lib/async/redis/context/multi.rb

Instance Method Summary collapse

Methods inherited from Nested

#close, #send_command

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

#discardObject



47
48
49
# File 'lib/async/redis/context/multi.rb', line 47

def discard
	return send_command 'DISCARD'
end

#executeObject



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