Module: Oxblood::Commands::Scripting
- Included in:
- Oxblood::Commands
- Defined in:
- lib/oxblood/commands/scripting.rb
Instance Method Summary collapse
-
#eval(script, numkeys, *keys_and_args) ⇒ Object
Execute a Lua script server side.
-
#evalsha(sha1, numkeys, *keys_and_args) ⇒ Object
Execute a Lua script server side.
-
#script_debug(mode) ⇒ String, RError
Set the debug mode for executed scripts.
-
#script_exists(*sha1_digests) ⇒ Array<Integer>
Check existence of scripts in the script cache.
-
#script_flush ⇒ String
Remove all the scripts from the script cache.
-
#script_kill ⇒ String, RError
Kill the script currently in execution.
-
#script_load(script) ⇒ String
Load the specified Lua script into the script cache.
Instance Method Details
#eval(script, numkeys, *keys_and_args) ⇒ Object
Execute a Lua script server side
36 37 38 |
# File 'lib/oxblood/commands/scripting.rb', line 36 def eval(script, numkeys, *keys_and_args) run(:EVAL, script, numkeys, keys_and_args) end |
#evalsha(sha1, numkeys, *keys_and_args) ⇒ Object
Execute a Lua script server side
46 47 48 |
# File 'lib/oxblood/commands/scripting.rb', line 46 def evalsha(sha1, numkeys, *keys_and_args) run(:EVALSHA, sha1, numkeys, keys_and_args) end |
#script_debug(mode) ⇒ String, RError
Set the debug mode for executed scripts.
57 58 59 |
# File 'lib/oxblood/commands/scripting.rb', line 57 def script_debug(mode) run(:SCRIPT, :DEBUG, mode) end |
#script_exists(*sha1_digests) ⇒ Array<Integer>
Check existence of scripts in the script cache.
69 70 71 |
# File 'lib/oxblood/commands/scripting.rb', line 69 def script_exists(*sha1_digests) run(*sha1_digests.unshift(:SCRIPT, :EXISTS)) end |
#script_flush ⇒ String
Remove all the scripts from the script cache.
77 78 79 |
# File 'lib/oxblood/commands/scripting.rb', line 77 def script_flush run(:SCRIPT, :FLUSH) end |
#script_kill ⇒ String, RError
Kill the script currently in execution.
86 87 88 |
# File 'lib/oxblood/commands/scripting.rb', line 86 def script_kill run(:SCRIPT, :KILL) end |
#script_load(script) ⇒ String
Load the specified Lua script into the script cache.
97 98 99 |
# File 'lib/oxblood/commands/scripting.rb', line 97 def script_load(script) run(:SCRIPT, :LOAD, script) end |