EsRedisScriptingCommands
Description
Provides an API for the Redis Scripting commands, which allow for the execution of Lua scripts on the server. This is a powerful feature for performing complex, atomic operations.
This command group is accessed via EsRedisClient>>scriptings.
Class Methods
None
Instance Methods
eval:numKeys:keys:args:
Executes a Lua script on the server.
Arguments:
aScript - <String> The Lua script.
anInteger - <Integer> The number of keys.
aCollectionOfKeys - <Collection> The keys.
aCollectionOfArgs - <Collection> The arguments.
Answers:
<Object> The result of the script execution. The container type depends on the script's return value.
<EsFuture> In async mode, a future that completes with the result.
evalsha:numKeys:keys:args:
Executes a script cached on the server by its SHA1 digest.
Arguments:
aSha1 - <String> The SHA1 digest of the script.
anInteger - <Integer> The number of keys.
aCollectionOfKeys - <Collection> The keys.
aCollectionOfArgs - <Collection> The arguments.
Answers:
<Object> The result of the script execution. The container type depends on the script's return value.
<EsFuture> In async mode, a future that completes with the result.
functionDelete:
Delete a library.
Arguments:
aLibraryName - <String> The name of the library to delete.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionDump
Return the serialized payload of all loaded libraries.
Answers:
<ByteArray> The serialized payload.
<EsFuture> In async mode, a future that completes with the result.
functionFlush
Delete all libraries.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionFlush:
Delete all libraries with an optional mode.
Arguments:
aMode - <String> 'ASYNC' or 'SYNC'.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionKill
Kill a function that is currently executing.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionList
Return a list of all libraries.
Answers:
<Dictionary> An dictionary of library information.
<EsFuture> In async mode, a future that completes with the result.
functionList:
Return a list of libraries with optional filters.
Arguments:
aCollectionOfArgs - <Collection> Optional arguments like LIBRARYNAME or WITHCODE.
Answers:
<Dictionary> A dictionary of library information.
<EsFuture> In async mode, a future that completes with the result.
functionLoad:
Load a function.
Arguments:
aFunctionCode - <String> The source code of the function.
Answers:
<String> The library name.
<EsFuture> In async mode, a future that completes with the result.
functionLoad:replace:
Load a function, optionally replacing an existing one.
Arguments:
aFunctionCode - <String> The source code of the function.
aBoolean - <Boolean> If true, replaces the existing function.
Answers:
<String> The library name.
<EsFuture> In async mode, a future that completes with the result.
functionRestore:
Restore libraries from a serialized payload.
Arguments:
aSerializedPayload - <ByteArray> The payload from FUNCTION DUMP.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionRestore:policy:
Restore libraries from a serialized payload with a policy.
Arguments:
aSerializedPayload - <ByteArray> The payload from FUNCTION DUMP.
aPolicy - <String> 'FLUSH', 'APPEND', or 'REPLACE'.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
functionStats
Return information about the function's engine.
Answers:
<Dictionary> A dictionary of statistics.
<EsFuture> In async mode, a future that completes with the result.
scriptExists:
Check existence of scripts in the script cache.
Arguments:
aSha1OrCollection - <String | Collection> The SHA1 digest or a collection of digests.
Answers:
<Array> An array of integers (1 for exists, 0 for not exists).
<EsFuture> In async mode, a future that completes with the result.
scriptFlush
Remove all the scripts from the script cache.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
scriptFlush:
Remove all the scripts from the script cache, with an optional mode.
Arguments:
aMode - <String> 'ASYNC' or 'SYNC'.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
scriptKill
Kill the script currently in execution.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
scriptLoad:
Load the specified script into the script cache.
Arguments:
aScript - <String> The script to load.
Answers:
<String> The SHA1 digest of the script.
<EsFuture> In async mode, a future that completes with the result.
Last modified date: 01/22/2026