class Async::Redis::Context::Transaction

Public Class Methods

new(pool, *arguments) click to toggle source
Calls superclass method Async::Redis::Context::Pipeline::new
# File lib/async/redis/context/transaction.rb, line 30
def initialize(pool, *arguments)
        super(pool)
end

Public Instance Methods

discard() click to toggle source
# File lib/async/redis/context/transaction.rb, line 47
def discard
        sync.call('DISCARD')
end
execute() click to toggle source

Execute all queued commands, provided that no watched keys have been modified. It's important to note that even when a command fails, all the other commands in the queue are processed – Redis will not stop the processing of commands.

# File lib/async/redis/context/transaction.rb, line 43
def execute
        sync.call('EXEC')
end
multi() click to toggle source
# File lib/async/redis/context/transaction.rb, line 34
def multi
        call('MULTI')
end
watch(*keys) click to toggle source
# File lib/async/redis/context/transaction.rb, line 38
def watch(*keys)
        sync.call('WATCH', *keys)
end