Database Reference
In-Depth Information
Scripting
Redis 2.6 introduced a built-in Lua scripting engine to eventually take the
place of its existing transaction facility. This functionality is accessed
through the EVAL command, which has the following form:
EVAL <script> <num keys> <key 1> ... <key n> <arg 1>
... <arg n>
Scripts can sometimes be quite long, so Redis also provides an EVALSHA
command, which uses the fixed-size SHA1 hash in place of the actual script.
If the redis server does not know about a particular script it returns a special
error that instructs the EVALSHA to fall back to the normal EVAL command.
Most clients do this implicitly when executing an EVAL command, so it is
usually not necessary to take this into account.
All scripts, no matter the client connection, execute in a single Lua
interpreter and can be considered to be essentially atomic operations when
compared against other scripts.
Search WWH ::




Custom Search