Script runner for the redis package.
This package loads scripts from the file system and caches them. Then uses EVALSHA to execute them.
Automatically reloads the script when it is removed from the db (
var redis = ;var redisScripts = ;var client = redis;var scripts =;scripts;
Assuming there is a script
var scripts = redisScripts(RedisClient client, [Object options])
Builds a script runner for a certain
Base folder for relative paths.
Either the path to a script that should be prepended to every script that is run.
Or an object with following properties:
String path: path to the shared script.
Array<String> keys: Optional array containg KEYS for the shared script. If this array conatins a function it will be executed to obtain the value for a key each time the script is run.
Array<String> argv: Optional array containing ARGV for the shared script. If this array conatins a function it will be executed to obtain the value for an argument each time the script is run.
Calculating shared arguments on the fly can be useful when you want to pass a timestamp or a random seed for instance.
scripts.run(String path, [Array<String> keys], [Array<String> argv])
Runs a script at
path. The path is resolved against the base dir.
.lua extension is automatically added when not specified.
argv can be passed as
ARGV variables in the script.