Context for Redis transaction operations using MULTI/EXEC.
Definitionsdef initialize(pool, *arguments)
Initialize a new transaction context.
Signaturepool
Pool
The connection pool to use.
arguments
Array
Additional arguments for the transaction.
def initialize(pool, *arguments)
super(pool)
end
def multi
Begin a transaction block.
Implementationdef multi
call("MULTI")
end
def watch(*keys)
Watch keys for changes during the transaction.
Signaturekeys
Array(String)
The keys to watch.
def watch(*keys)
sync.call("WATCH", *keys)
end
def execute
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.
Implementationdef execute
sync.call("EXEC")
end
def discard
Discard all queued commands in the transaction.
Implementationdef discard
sync.call("DISCARD")
end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4