Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Redis Client

David Newman edited this page Sep 19, 2017 · 22 revisions

cpp_redis::redis_client is the class providing communication with a Redis server.

It is meant to be used for sending commands to the remote server and receiving its replies.

The client support asynchronous requests, as well as synchronous ones. Moreover, commands pipelining is supported.

Methods

connect

void connect(const std::string& host = "127.0.0.1", unsigned int port = 6379, const disconnection_handler& handler = nullptr)

Description

Connects to the Redis Server. Connection is done synchronously. Throws redis_error in the case of a failure or if the client is already connected.

Also, sets the disconnection handler which is called whenever a disconnection has occurred. Disconnection handler is an std::function<void(redis_client&)>.

Parameters

Type Name Description
const std::string& host Host to be connected to
unsigned int port Port of the hot to be connected to. If port is 0, host will be considered as a path to a unix socket and port will be ignored.
const disconnection_handler& handler Callback to be called on client disconnection

Return Value

None.

disconnect

void disconnect(bool wait_for_removal = false)

Description

Disconnects client from remote host. Throws redis_error if the client is not connected to any server.

Parameters

Type Name Description
bool wait_for_removal When sets to true, disconnect blocks until the underlying TCP client has been effectively removed from the io_service and that all the underlying callbacks have completed.

Return value

None.

is_connected

bool is_connected(void)

Description

Returns whether the client is connected or not.

Parameters

None.

Return value

Whether the client is connected or not.

send

redis_client& send(const std::vector<std::string>& redis_cmd, const reply_callback& callback = nullptr)

Description

Sends a command and sets the callback which has to be called when the reply has been received. If nullptr is passed as callback, command is executed and no callback will be called. Reply callback is an std::function<void(reply&)>.

The command is not effectively sent immediately but stored in an internal buffer until commit() is called.

Parameters

Type Name Description
const std::vectorstd::string& redis_cmd Vector of std::string containing the command to be executed. Each item in the vector is supposed to be one word of the command like { "GET", "hello" }
const reply_callback& callback Callback to be executed once reply has been received by the redis server

Return value

Reference to the current instance of the redis_client.

commit

redis_client& commit(void)

Description

Sends all the commands that have been stored by calling send() since the last commit() call to the redis server.

That is, pipelining is supported in a very simple and efficient way: client.send(...).send(...).send(...).commit() will send the 3 commands at once (instead of sending 3 network requests, one for each command, as it would have been done without pipelining).

Pipelined commands are always removed from the buffer, even in the case of an error (for example, calling commit while the client is not connected, something that throws an exception).

commit() works asynchronously: it returns immediately after sending the queued requests and replies are processed asynchronously.

Another version of commit(), sync_commit(), provides a synchronous version of the commit function. It sends all the requests and waits that all replies are received and that all the callbacks are executed before returning.

sync_commit() also support timeout, using std::chrono: client.sync_commit(std::chrono::milliseconds(100));.

Please note that, while commit() can safely be called from inside a reply callback, calling sync_commit() from inside a reply callback is not permitted and will lead to undefined behavior, mostly deadlock.

Parameters

None.

Return value

Reference to the current instance of the redis_client.

set_callback_runner

redis_client& set_callback_runner(const std::function<void(reply&, const reply_callback_t& callback)>& callback_runner)

Description

set_callback_runner is a method that allows you to set a callback which is executed whenever a reply callback is going to be executed and allows you to run this reply callback by yourself.

This can be useful in the case you need to execute pre and after callback hooks.

set_callback_runner sets the callback runner globally to the redis_client instance, meaning that all replies callbacks will have to be run by the callback_runner since the redis_client will not run any callbacks by himself.

Basically, without callback_runner, the workflow is the following:

[Send Command]->[Commit]->[Receive Reply]->[Execute Callback]

With callback_runner, the workflow is the following:

[Send Command]->[Commit]->[Receive Reply]->[Execute Callback Runner]

callback runner takes as a parameter the reply and the callback associated to that reply and meant to be called.

Parameters

Type Name Description
const std::function<void(reply&, const reply_callback_t& callback)>& callback_runner Callback to be executed once each command reply is received

Return value

Reference to the current instance of the redis_client.

Commands

The following list contains all the supported commands. If a command is missing or that the method to call that command is not convenient, please consider using the send() method directly.

All the following member functions are wrappers for the send() function to provide more code clarity.

redis_client& append(const std::string& key, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& auth(const std::string& password, const reply_callback_t& reply_callback = nullptr)
redis_client& bgrewriteaof(const reply_callback_t& reply_callback = nullptr)
redis_client& bgsave(const reply_callback_t& reply_callback = nullptr)
redis_client& bitcount(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& bitcount(const std::string& key, int start, int end, const reply_callback_t& reply_callback = nullptr)
redis_client& bitop(const std::string& operation, const std::string& destkey, const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& bitpos(const std::string& key, int bit, const reply_callback_t& reply_callback = nullptr)
redis_client& bitpos(const std::string& key, int bit, int start, const reply_callback_t& reply_callback = nullptr)
redis_client& bitpos(const std::string& key, int bit, int start, int end, const reply_callback_t& reply_callback = nullptr)
redis_client& blpop(const std::vector<std::string>& keys, int timeout, const reply_callback_t& reply_callback = nullptr)
redis_client& brpop(const std::vector<std::string>& keys, int timeout, const reply_callback_t& reply_callback = nullptr)
redis_client& brpoplpush(const std::string& src, const std::string& dst, int timeout, const reply_callback_t& reply_callback = nullptr)
template <typename T, typename... Ts>
redis_client& client_kill(const std::string& host, int port, const T& arg, const Ts&... args)
redis_client& client_kill(const std::string& host, int port)
template <typename... Ts>
redis_client& client_kill(const char* host, int port, const Ts&... args)
template <typename T, typename... Ts>
redis_client& client_kill(const T&, const Ts&...)
redis_client& client_list(const reply_callback_t& reply_callback = nullptr)
redis_client& client_getname(const reply_callback_t& reply_callback = nullptr)
redis_client& client_pause(int timeout, const reply_callback_t& reply_callback = nullptr)
redis_client& client_reply(const std::string& mode, const reply_callback_t& reply_callback = nullptr)
redis_client& client_setname(const std::string& name, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_addslots(const std::vector<std::string>& slots, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_count_failure_reports(const std::string& node_id, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_countkeysinslot(const std::string& slot, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_delslots(const std::vector<std::string>& slots, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_failover(const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_failover(const std::string& mode, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_forget(const std::string& node_id, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_getkeysinslot(const std::string& slot, int count, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_info(const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_keyslot(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_meet(const std::string& ip, int port, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_nodes(const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_replicate(const std::string& node_id, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_reset(const std::string& mode = "soft", const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_saveconfig(const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_set_config_epoch(const std::string& epoch, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_setslot(const std::string& slot, const std::string& mode, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_setslot(const std::string& slot, const std::string& mode, const std::string& node_id, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_slaves(const std::string& node_id, const reply_callback_t& reply_callback = nullptr)
redis_client& cluster_slots(const reply_callback_t& reply_callback = nullptr)
redis_client& command(const reply_callback_t& reply_callback = nullptr)
redis_client& command_count(const reply_callback_t& reply_callback = nullptr)
redis_client& command_getkeys(const reply_callback_t& reply_callback = nullptr)
redis_client& command_info(const std::vector<std::string>& command_name, const reply_callback_t& reply_callback = nullptr)
redis_client& config_get(const std::string& param, const reply_callback_t& reply_callback = nullptr)
redis_client& config_rewrite(const reply_callback_t& reply_callback = nullptr)
redis_client& config_set(const std::string& param, const std::string& val, const reply_callback_t& reply_callback = nullptr)
redis_client& config_resetstat(const reply_callback_t& reply_callback = nullptr)
redis_client& dbsize(const reply_callback_t& reply_callback = nullptr)
redis_client& debug_object(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& debug_segfault(const reply_callback_t& reply_callback = nullptr)
redis_client& decr(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& decrby(const std::string& key, int val, const reply_callback_t& reply_callback = nullptr)
redis_client& del(const std::vector<std::string>& key, const reply_callback_t& reply_callback = nullptr)
redis_client& discard(const reply_callback_t& reply_callback = nullptr)
redis_client& dump(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& echo(const std::string& msg, const reply_callback_t& reply_callback = nullptr)
redis_client& eval(const std::string& script, int numkeys, const std::vector<std::string>& keys, const std::vector<std::string>& args, const reply_callback_t& reply_callback = nullptr)
redis_client& evalsha(const std::string& sha1, int numkeys, const std::vector<std::string>& keys, const std::vector<std::string>& args, const reply_callback_t& reply_callback = nullptr)
redis_client& exec(const reply_callback_t& reply_callback = nullptr)
redis_client& exists(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& expire(const std::string& key, int seconds, const reply_callback_t& reply_callback = nullptr)
redis_client& expireat(const std::string& key, int timestamp, const reply_callback_t& reply_callback = nullptr)
redis_client& flushall(const reply_callback_t& reply_callback = nullptr)
redis_client& flushdb(const reply_callback_t& reply_callback = nullptr)
redis_client& geoadd(const std::string& key, const std::vector<std::tuple<std::string, std::string, std::string>>& long_lat_memb, const reply_callback_t& reply_callback = nullptr)
redis_client& geohash(const std::string& key, const std::vector<std::string>& members, const reply_callback_t& reply_callback = nullptr)
redis_client& geopos(const std::string& key, const std::vector<std::string>& members, const reply_callback_t& reply_callback = nullptr)
redis_client& geodist(const std::string& key, const std::string& member_1, const std::string& member_2, const std::string& unit = "m", const reply_callback_t& reply_callback = nullptr)
redis_client& get(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& getbit(const std::string& key, int offset, const reply_callback_t& reply_callback = nullptr)
redis_client& getrange(const std::string& key, int start, int end, const reply_callback_t& reply_callback = nullptr)
redis_client& getset(const std::string& key, const std::string& val, const reply_callback_t& reply_callback = nullptr)
redis_client& hdel(const std::string& key, const std::vector<std::string>& fields, const reply_callback_t& reply_callback = nullptr)
redis_client& hexists(const std::string& key, const std::string& field, const reply_callback_t& reply_callback = nullptr)
redis_client& hget(const std::string& key, const std::string& field, const reply_callback_t& reply_callback = nullptr)
redis_client& hgetall(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& hincrby(const std::string& key, const std::string& field, int incr, const reply_callback_t& reply_callback = nullptr)
redis_client& hincrbyfloat(const std::string& key, const std::string& field, float incr, const reply_callback_t& reply_callback = nullptr)
redis_client& hkeys(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& hlen(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& hmget(const std::string& key, const std::vector<std::string>& fields, const reply_callback_t& reply_callback = nullptr)
redis_client& hmset(const std::string& key, const std::vector<std::pair<std::string, std::string>>& field_val, const reply_callback_t& reply_callback = nullptr)
redis_client& hset(const std::string& key, const std::string& field, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& hsetnx(const std::string& key, const std::string& field, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& hstrlen(const std::string& key, const std::string& field, const reply_callback_t& reply_callback = nullptr)
redis_client& hvals(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& incr(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& incrby(const std::string& key, int incr, const reply_callback_t& reply_callback = nullptr)
redis_client& incrbyfloat(const std::string& key, float incr, const reply_callback_t& reply_callback = nullptr)
redis_client& info(const std::string& section = "default", const reply_callback_t& reply_callback = nullptr)
redis_client& keys(const std::string& pattern, const reply_callback_t& reply_callback = nullptr)
redis_client& lastsave(const reply_callback_t& reply_callback = nullptr)
redis_client& lindex(const std::string& key, int index, const reply_callback_t& reply_callback = nullptr)
redis_client& linsert(const std::string& key, const std::string& before_after, const std::string& pivot, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& llen(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& lpop(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& lpush(const std::string& key, const std::vector<std::string>& values, const reply_callback_t& reply_callback = nullptr)
redis_client& lpushx(const std::string& key, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& lrange(const std::string& key, int start, int stop, const reply_callback_t& reply_callback = nullptr)
redis_client& lrem(const std::string& key, int count, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& lset(const std::string& key, int index, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& ltrim(const std::string& key, int start, int stop, const reply_callback_t& reply_callback = nullptr)
redis_client& mget(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& migrate(const std::string& host, int port, const std::string& key, const std::string& dest_db, int timeout, bool copy = false, bool replace = false, const std::vector<std::string>& keys = {}, const reply_callback_t& reply_callback = nullptr)
redis_client& monitor(const reply_callback_t& reply_callback = nullptr)
redis_client& move(const std::string& key, const std::string& db, const reply_callback_t& reply_callback = nullptr)
redis_client& mset(const std::vector<std::pair<std::string, std::string>>& key_vals, const reply_callback_t& reply_callback = nullptr)
redis_client& msetnx(const std::vector<std::pair<std::string, std::string>>& key_vals, const reply_callback_t& reply_callback = nullptr)
redis_client& multi(const reply_callback_t& reply_callback = nullptr)
redis_client& object(const std::string& subcommand, const std::vector<std::string>& args, const reply_callback_t& reply_callback = nullptr)
redis_client& persist(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& pexpire(const std::string& key, int milliseconds, const reply_callback_t& reply_callback = nullptr)
redis_client& pexpireat(const std::string& key, int milliseconds_timestamp, const reply_callback_t& reply_callback = nullptr)
redis_client& pfadd(const std::string& key, const std::vector<std::string>& elements, const reply_callback_t& reply_callback = nullptr)
redis_client& pfcount(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& pfmerge(const std::string& destkey, const std::vector<std::string>& sourcekeys, const reply_callback_t& reply_callback = nullptr)
redis_client& ping(const reply_callback_t& reply_callback = nullptr)
redis_client& ping(const std::string& message, const reply_callback_t& reply_callback = nullptr)
redis_client& psetex(const std::string& key, int milliseconds, const std::string& val, const reply_callback_t& reply_callback = nullptr)
redis_client& publish(const std::string& channel, const std::string& message, const reply_callback_t& reply_callback = nullptr)
redis_client& pubsub(const std::string& subcommand, const std::vector<std::string>& args, const reply_callback_t& reply_callback = nullptr)
redis_client& pttl(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& quit(const reply_callback_t& reply_callback = nullptr)
redis_client& randomkey(const reply_callback_t& reply_callback = nullptr)
redis_client& readonly(const reply_callback_t& reply_callback = nullptr)
redis_client& readwrite(const reply_callback_t& reply_callback = nullptr)
redis_client& rename(const std::string& key, const std::string& newkey, const reply_callback_t& reply_callback = nullptr)
redis_client& renamenx(const std::string& key, const std::string& newkey, const reply_callback_t& reply_callback = nullptr)
redis_client& restore(const std::string& key, int ttl, const std::string& serialized_value, const reply_callback_t& reply_callback = nullptr)
redis_client& restore(const std::string& key, int ttl, const std::string& serialized_value, const std::string& replace, const reply_callback_t& reply_callback = nullptr)
redis_client& role(const reply_callback_t& reply_callback = nullptr)
redis_client& rpop(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& rpoplpush(const std::string& source, const std::string& destination, const reply_callback_t& reply_callback = nullptr)
redis_client& rpush(const std::string& key, const std::vector<std::string>& values, const reply_callback_t& reply_callback = nullptr)
redis_client& rpushx(const std::string& key, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& sadd(const std::string& key, const std::vector<std::string>& members, const reply_callback_t& reply_callback = nullptr)
redis_client& save(const reply_callback_t& reply_callback = nullptr)
redis_client& scard(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& script_debug(const std::string& mode, const reply_callback_t& reply_callback = nullptr)
redis_client& script_exists(const std::vector<std::string>& scripts, const reply_callback_t& reply_callback = nullptr)
redis_client& script_flush(const reply_callback_t& reply_callback = nullptr)
redis_client& script_kill(const reply_callback_t& reply_callback = nullptr)
redis_client& script_load(const std::string& script, const reply_callback_t& reply_callback = nullptr)
redis_client& sdiff(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& sdiffstore(const std::string& destination, const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& select(int index, const reply_callback_t& reply_callback = nullptr)
redis_client& set(const std::string& key, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& set_advanced(const std::string& key, const std::string& value, bool ex = false, int ex_sec = 0, bool px = false, int px_milli = 0, bool nx = false, bool xx = false, const reply_callback_t& reply_callback = nullptr)
redis_client& setbit(const std::string& key, int offset, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& setex(const std::string& key, int seconds, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& setnx(const std::string& key, const std::string& value, const reply_callback_t& reply_callback = nullptr) ;
redis_client& setrange(const std::string& key, int offset, const std::string& value, const reply_callback_t& reply_callback = nullptr)
redis_client& shutdown(const reply_callback_t& reply_callback = nullptr)
redis_client& shutdown(const std::string& save, const reply_callback_t& reply_callback = nullptr)
redis_client& sinter(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& sinterstore(const std::string& destination, const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& sismember(const std::string& key, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& slaveof(const std::string& host, int port, const reply_callback_t& reply_callback = nullptr)
redis_client& slowlog(const std::string subcommand, const reply_callback_t& reply_callback = nullptr)
redis_client& slowlog(const std::string subcommand, const std::string& argument, const reply_callback_t& reply_callback = nullptr)
redis_client& smembers(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& smove(const std::string& source, const std::string& destination, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& spop(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& spop(const std::string& key, int count, const reply_callback_t& reply_callback = nullptr)
redis_client& srandmember(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& srandmember(const std::string& key, int count, const reply_callback_t& reply_callback = nullptr)
redis_client& srem(const std::string& key, const std::vector<std::string>& members, const reply_callback_t& reply_callback = nullptr)
redis_client& strlen(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& sunion(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& sunionstore(const std::string& destination, const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& sync(const reply_callback_t& reply_callback = nullptr)
redis_client& time(const reply_callback_t& reply_callback = nullptr)
redis_client& ttl(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& type(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& unwatch(const reply_callback_t& reply_callback = nullptr)
redis_client& wait(int numslaves, int timeout, const reply_callback_t& reply_callback = nullptr)
redis_client& watch(const std::vector<std::string>& keys, const reply_callback_t& reply_callback = nullptr)
redis_client& zadd(const std::string& key, const std::vector<std::string> options, const std::map<std::string, std::string> score_members, const reply_callback_t& reply_callback = nullptr)
redis_client& zcard(const std::string& key, const reply_callback_t& reply_callback = nullptr)
redis_client& zcount(const std::string& key, int min, int max, const reply_callback_t& reply_callback = nullptr)
redis_client& zcount(const std::string& key, double min, double max, const reply_callback_t& reply_callback = nullptr)
redis_client& zcount(const std::string& key, const std::string& min, const std::string& max, const reply_callback_t& reply_callback = nullptr)
redis_client& zincrby(const std::string& key, int incr, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& zincrby(const std::string& key, double incr, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& zincrby(const std::string& key, const std::string& incr, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& zlexcount(const std::string& key, int min, int max, const reply_callback_t& reply_callback = nullptr)
redis_client& zlexcount(const std::string& key, double min, double max, const reply_callback_t& reply_callback = nullptr)
redis_client& zlexcount(const std::string& key, const std::string& min, const std::string& max, const reply_callback_t& reply_callback = nullptr)
redis_client& zrange(const std::string& key, int start, int stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zrange(const std::string& key, double start, double stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zrange(const std::string& key, const std::string& start, const std::string& stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zrank(const std::string& key, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& zrem(const std::string& key, const std::vector<std::string>& members, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebylex(const std::string& key, int min, int max, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebylex(const std::string& key, double min, double max, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebylex(const std::string& key, const std::string& min, const std::string& max, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyrank(const std::string& key, int start, int stop, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyrank(const std::string& key, double start, double stop, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyrank(const std::string& key, const std::string& start, const std::string& stop, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyscore(const std::string& key, int min, int max, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyscore(const std::string& key, double min, double max, const reply_callback_t& reply_callback = nullptr)
redis_client& zremrangebyscore(const std::string& key, const std::string& min, const std::string& max, const reply_callback_t& reply_callback = nullptr)
redis_client& zrevrange(const std::string& key, int start, int stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zrevrank(const std::string& key, const std::string& member, const reply_callback_t& reply_callback = nullptr)
redis_client& zrevrange(const std::string& key, double start, double stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zrevrange(const std::string& key, const std::string& start, const std::string& stop, bool withscores = false, const reply_callback_t& reply_callback = nullptr)
redis_client& zscore(const std::string& key, const std::string& member, const reply_callback_t& reply_callback = nullptr)

For an example of the client_kill command, please review this part of the wiki.

Clone this wiki locally