Helps to run Lua scripts on a Redis instance. It will take care to use EVALSHA to optimize performance and then EVAL if the script is not yet available on Redis server. See http://redis.io/commands/eval for other infos. More...
#include <script_exec.h>
Public Member Functions | |
script_exec (const std::string &script, bool is_path=false) | |
Create script_exec. More... | |
reply | exec (connection::ptr_t connection, const std::vector< std::string > &keys=std::vector< std::string >(), const std::vector< std::string > &args=std::vector< std::string >()) |
Execute the script. First trying with EVALSHA, then with EVAL. More... | |
Helps to run Lua scripts on a Redis instance. It will take care to use EVALSHA to optimize performance and then EVAL if the script is not yet available on Redis server. See http://redis.io/commands/eval for other infos.
patterns::script_exec::script_exec | ( | const std::string & | script, |
bool | is_path = false |
||
) |
Create script_exec.
script | script content or a path to a file which contains the script |
is_path | true if previous argument is a path, false otherwise. The latter is default. |
reply patterns::script_exec::exec | ( | connection::ptr_t | connection, |
const std::vector< std::string > & | keys = std::vector<std::string>() , |
||
const std::vector< std::string > & | args = std::vector<std::string>() |
||
) |
Execute the script. First trying with EVALSHA, then with EVAL.
connection | |
keys | vector of keys used by the script |
args |