I have a scenario where a verification need to happen before running a redis command. The command should only be run if verification passes. I am thinking of using lua scripting to do this. The command that needs to be run together with its arguments should be specified as arguments to the lua script.
The logic of this script is of the form:
if verify(KEYS[1], ARGV[1]) then
redis.call(ARGV[2], KEYS[2], <the rest of arguments for the command ARGV[2])
done
The number of arguments needed in the redis.call method depends on the command that is executed (ARGV[2]). These arguments are specified to the script through ARGV[3] to ARGV[n], where n >= 3. I would like to understand how these arguments can be passed to the call method.