Module: Protocol::Redis::Methods::Scripting

Defined in:
lib/protocol/redis/methods/scripting.rb

Instance Method Summary collapse

Instance Method Details

#eval(*arguments) ⇒ Object

Execute a Lua script server side. Depends on the script that is executed.

Parameters:

  • script (String)
  • numkeys (Integer)
  • key (Key)
  • arg (String)

See Also:



33
34
35
# File 'lib/protocol/redis/methods/scripting.rb', line 33

def eval(*arguments)
	call("EVAL", *arguments)
end

#evalsha(*arguments) ⇒ Object

Execute a Lua script server side. Depends on the script that is executed.

Parameters:

  • sha1 (String)
  • numkeys (Integer)
  • key (Key)
  • arg (String)

See Also:



43
44
45
# File 'lib/protocol/redis/methods/scripting.rb', line 43

def evalsha(*arguments)
	call("EVALSHA", *arguments)
end

#script_debug(*arguments) ⇒ Object

Set the debug mode for executed scripts. O(1).

Parameters:

  • mode (Enum)

See Also:



50
51
52
# File 'lib/protocol/redis/methods/scripting.rb', line 50

def script_debug(*arguments)
	call("SCRIPT DEBUG", *arguments)
end

#script_exists(*arguments) ⇒ Object

Check existence of scripts in the script cache. O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation).

Parameters:

  • sha1 (String)

See Also:



57
58
59
# File 'lib/protocol/redis/methods/scripting.rb', line 57

def script_exists(*arguments)
	call("SCRIPT EXISTS", *arguments)
end

#script_flush(*arguments) ⇒ Object

Remove all the scripts from the script cache. O(N) with N being the number of scripts in cache.

See Also:



63
64
65
# File 'lib/protocol/redis/methods/scripting.rb', line 63

def script_flush(*arguments)
	call("SCRIPT FLUSH", *arguments)
end

#script_kill(*arguments) ⇒ Object

Kill the script currently in execution. O(1).

See Also:



69
70
71
# File 'lib/protocol/redis/methods/scripting.rb', line 69

def script_kill(*arguments)
	call("SCRIPT KILL", *arguments)
end

#script_load(*arguments) ⇒ Object

Load the specified Lua script into the script cache. O(N) with N being the length in bytes of the script body.

Parameters:

  • script (String)

See Also:



76
77
78
# File 'lib/protocol/redis/methods/scripting.rb', line 76

def script_load(*arguments)
	call("SCRIPT LOAD", *arguments)
end