cpp_redis  4.0.0
cpp_redis is a C++11 Asynchronous Multi-Platform Lightweight Redis Client, with support for synchronous operations and pipelining.
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cpp_redis::client Class Reference

#include <client.hpp>

Classes

struct  command_request
 

Public Types

enum  client_type { client_type::normal, client_type::master, client_type::pubsub, client_type::slave }
 
enum  connect_state {
  connect_state::dropped, connect_state::start, connect_state::sleeping, connect_state::ok,
  connect_state::failed, connect_state::lookup_failed, connect_state::stopped
}
 
typedef std::function< void(const std::string &host, std::size_t port, connect_state status)> connect_callback_t
 
typedef std::function< void(reply &)> reply_callback_t
 

Public Member Functions

 client (void)
 ctor More...
 
 client (const std::shared_ptr< network::tcp_client_iface > &tcp_client)
 
 ~client (void)
 dtor More...
 
 client (const client &)=delete
 copy ctor More...
 
clientoperator= (const client &)=delete
 assignment operator More...
 
void connect (const std::string &host="127.0.0.1", std::size_t port=6379, const connect_callback_t &connect_callback=nullptr, std::uint32_t timeout_msecs=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_msecs=0)
 
void connect (const std::string &name, const connect_callback_t &connect_callback=nullptr, std::uint32_t timeout_msecs=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_msecs=0)
 
bool is_connected (void) const
 
void disconnect (bool wait_for_removal=false)
 
bool is_reconnecting (void) const
 
void cancel_reconnect (void)
 
clientsend (const std::vector< std::string > &redis_cmd, const reply_callback_t &callback)
 
std::future< replysend (const std::vector< std::string > &redis_cmd)
 
clientcommit (void)
 
clientsync_commit (void)
 
template<class Rep , class Period >
clientsync_commit (const std::chrono::duration< Rep, Period > &timeout)
 
void add_sentinel (const std::string &host, std::size_t port)
 
const sentinelget_sentinel (void) const
 
sentinelget_sentinel (void)
 
void clear_sentinels (void)
 
clientappend (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replyappend (const std::string &key, const std::string &value)
 
clientauth (const std::string &password, const reply_callback_t &reply_callback)
 
std::future< replyauth (const std::string &password)
 
clientbgrewriteaof (const reply_callback_t &reply_callback)
 
std::future< replybgrewriteaof ()
 
clientbgsave (const reply_callback_t &reply_callback)
 
std::future< replybgsave ()
 
clientbitcount (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replybitcount (const std::string &key)
 
clientbitcount (const std::string &key, int start, int end, const reply_callback_t &reply_callback)
 
std::future< replybitcount (const std::string &key, int start, int end)
 
clientbitop (const std::string &operation, const std::string &destkey, const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replybitop (const std::string &operation, const std::string &destkey, const std::vector< std::string > &keys)
 
clientbitpos (const std::string &key, int bit, const reply_callback_t &reply_callback)
 
std::future< replybitpos (const std::string &key, int bit)
 
clientbitpos (const std::string &key, int bit, int start, const reply_callback_t &reply_callback)
 
std::future< replybitpos (const std::string &key, int bit, int start)
 
clientbitpos (const std::string &key, int bit, int start, int end, const reply_callback_t &reply_callback)
 
std::future< replybitpos (const std::string &key, int bit, int start, int end)
 
clientblpop (const std::vector< std::string > &keys, int timeout, const reply_callback_t &reply_callback)
 
std::future< replyblpop (const std::vector< std::string > &keys, int timeout)
 
clientbrpop (const std::vector< std::string > &keys, int timeout, const reply_callback_t &reply_callback)
 
std::future< replybrpop (const std::vector< std::string > &keys, int timeout)
 
clientbrpoplpush (const std::string &src, const std::string &dst, int timeout, const reply_callback_t &reply_callback)
 
std::future< replybrpoplpush (const std::string &src, const std::string &dst, int timeout)
 
template<typename T , typename... Ts>
clientclient_kill (const std::string &host, int port, const T &arg, const Ts &... args)
 
clientclient_kill (const std::string &host, int port)
 
template<typename... Ts>
clientclient_kill (const char *host, int port, const Ts &... args)
 
template<typename T , typename... Ts>
clientclient_kill (const T &, const Ts &...)
 
template<typename T , typename... Ts>
std::future< replyclient_kill_future (const T, const Ts...)
 
clientclient_list (const reply_callback_t &reply_callback)
 
std::future< replyclient_list ()
 
clientclient_getname (const reply_callback_t &reply_callback)
 
std::future< replyclient_getname ()
 
clientclient_pause (int timeout, const reply_callback_t &reply_callback)
 
std::future< replyclient_pause (int timeout)
 
clientclient_reply (const std::string &mode, const reply_callback_t &reply_callback)
 
std::future< replyclient_reply (const std::string &mode)
 
clientclient_setname (const std::string &name, const reply_callback_t &reply_callback)
 
std::future< replyclient_setname (const std::string &name)
 
clientcluster_addslots (const std::vector< std::string > &p_slots, const reply_callback_t &reply_callback)
 
std::future< replycluster_addslots (const std::vector< std::string > &p_slots)
 
clientcluster_count_failure_reports (const std::string &node_id, const reply_callback_t &reply_callback)
 
std::future< replycluster_count_failure_reports (const std::string &node_id)
 
clientcluster_countkeysinslot (const std::string &slot, const reply_callback_t &reply_callback)
 
std::future< replycluster_countkeysinslot (const std::string &slot)
 
clientcluster_delslots (const std::vector< std::string > &p_slots, const reply_callback_t &reply_callback)
 
std::future< replycluster_delslots (const std::vector< std::string > &p_slots)
 
clientcluster_failover (const reply_callback_t &reply_callback)
 
std::future< replycluster_failover ()
 
clientcluster_failover (const std::string &mode, const reply_callback_t &reply_callback)
 
std::future< replycluster_failover (const std::string &mode)
 
clientcluster_forget (const std::string &node_id, const reply_callback_t &reply_callback)
 
std::future< replycluster_forget (const std::string &node_id)
 
clientcluster_getkeysinslot (const std::string &slot, int count, const reply_callback_t &reply_callback)
 
std::future< replycluster_getkeysinslot (const std::string &slot, int count)
 
clientcluster_info (const reply_callback_t &reply_callback)
 
std::future< replycluster_info ()
 
clientcluster_keyslot (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replycluster_keyslot (const std::string &key)
 
clientcluster_meet (const std::string &ip, int port, const reply_callback_t &reply_callback)
 
std::future< replycluster_meet (const std::string &ip, int port)
 
clientcluster_nodes (const reply_callback_t &reply_callback)
 
std::future< replycluster_nodes ()
 
clientcluster_replicate (const std::string &node_id, const reply_callback_t &reply_callback)
 
std::future< replycluster_replicate (const std::string &node_id)
 
clientcluster_reset (const reply_callback_t &reply_callback)
 
clientcluster_reset (const std::string &mode, const reply_callback_t &reply_callback)
 
std::future< replycluster_reset (const std::string &mode="soft")
 
clientcluster_saveconfig (const reply_callback_t &reply_callback)
 
std::future< replycluster_saveconfig ()
 
clientcluster_set_config_epoch (const std::string &epoch, const reply_callback_t &reply_callback)
 
std::future< replycluster_set_config_epoch (const std::string &epoch)
 
clientcluster_setslot (const std::string &slot, const std::string &mode, const reply_callback_t &reply_callback)
 
std::future< replycluster_setslot (const std::string &slot, const std::string &mode)
 
clientcluster_setslot (const std::string &slot, const std::string &mode, const std::string &node_id, const reply_callback_t &reply_callback)
 
std::future< replycluster_setslot (const std::string &slot, const std::string &mode, const std::string &node_id)
 
clientcluster_slaves (const std::string &node_id, const reply_callback_t &reply_callback)
 
std::future< replycluster_slaves (const std::string &node_id)
 
clientcluster_slots (const reply_callback_t &reply_callback)
 
std::future< replycluster_slots ()
 
clientcommand (const reply_callback_t &reply_callback)
 
std::future< replycommand ()
 
clientcommand_count (const reply_callback_t &reply_callback)
 
std::future< replycommand_count ()
 
clientcommand_getkeys (const reply_callback_t &reply_callback)
 
std::future< replycommand_getkeys ()
 
clientcommand_info (const std::vector< std::string > &command_name, const reply_callback_t &reply_callback)
 
std::future< replycommand_info (const std::vector< std::string > &command_name)
 
clientconfig_get (const std::string &param, const reply_callback_t &reply_callback)
 
std::future< replyconfig_get (const std::string &param)
 
clientconfig_rewrite (const reply_callback_t &reply_callback)
 
std::future< replyconfig_rewrite ()
 
clientconfig_set (const std::string &param, const std::string &val, const reply_callback_t &reply_callback)
 
std::future< replyconfig_set (const std::string &param, const std::string &val)
 
clientconfig_resetstat (const reply_callback_t &reply_callback)
 
std::future< replyconfig_resetstat ()
 
clientdbsize (const reply_callback_t &reply_callback)
 
std::future< replydbsize ()
 
clientdebug_object (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replydebug_object (const std::string &key)
 
clientdebug_segfault (const reply_callback_t &reply_callback)
 
std::future< replydebug_segfault ()
 
clientdecr (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replydecr (const std::string &key)
 
clientdecrby (const std::string &key, int val, const reply_callback_t &reply_callback)
 
std::future< replydecrby (const std::string &key, int val)
 
clientdel (const std::vector< std::string > &key, const reply_callback_t &reply_callback)
 
std::future< replydel (const std::vector< std::string > &key)
 
clientdiscard (const reply_callback_t &reply_callback)
 
std::future< replydiscard ()
 
clientdump (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replydump (const std::string &key)
 
clientecho (const std::string &msg, const reply_callback_t &reply_callback)
 
std::future< replyecho (const std::string &msg)
 
clienteval (const std::string &script, int numkeys, const std::vector< std::string > &keys, const std::vector< std::string > &args, const reply_callback_t &reply_callback)
 
std::future< replyeval (const std::string &script, int numkeys, const std::vector< std::string > &keys, const std::vector< std::string > &args)
 
clientevalsha (const std::string &sha1, int numkeys, const std::vector< std::string > &keys, const std::vector< std::string > &args, const reply_callback_t &reply_callback)
 
std::future< replyevalsha (const std::string &sha1, int numkeys, const std::vector< std::string > &keys, const std::vector< std::string > &args)
 
clientexec (const reply_callback_t &reply_callback)
 
std::future< replyexec ()
 
clientexists (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replyexists (const std::vector< std::string > &keys)
 
clientexpire (const std::string &key, int seconds, const reply_callback_t &reply_callback)
 
std::future< replyexpire (const std::string &key, int seconds)
 
clientexpireat (const std::string &key, int timestamp, const reply_callback_t &reply_callback)
 
std::future< replyexpireat (const std::string &key, int timestamp)
 
clientflushall (const reply_callback_t &reply_callback)
 
std::future< replyflushall ()
 
clientflushdb (const reply_callback_t &reply_callback)
 
std::future< replyflushdb ()
 
clientgeoadd (const std::string &key, const std::vector< std::tuple< std::string, std::string, std::string >> &long_lat_memb, const reply_callback_t &reply_callback)
 
std::future< replygeoadd (const std::string &key, const std::vector< std::tuple< std::string, std::string, std::string >> &long_lat_memb)
 
clientgeohash (const std::string &key, const std::vector< std::string > &members, const reply_callback_t &reply_callback)
 
std::future< replygeohash (const std::string &key, const std::vector< std::string > &members)
 
clientgeopos (const std::string &key, const std::vector< std::string > &members, const reply_callback_t &reply_callback)
 
std::future< replygeopos (const std::string &key, const std::vector< std::string > &members)
 
clientgeodist (const std::string &key, const std::string &member_1, const std::string &member_2, const reply_callback_t &reply_callback)
 
clientgeodist (const std::string &key, const std::string &member_1, const std::string &member_2, const std::string &unit, const reply_callback_t &reply_callback)
 
std::future< replygeodist (const std::string &key, const std::string &member_1, const std::string &member_2, const std::string &unit="m")
 
clientget (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyget (const std::string &key)
 
clientgetbit (const std::string &key, int offset, const reply_callback_t &reply_callback)
 
std::future< replygetbit (const std::string &key, int offset)
 
clientgetrange (const std::string &key, int start, int end, const reply_callback_t &reply_callback)
 
std::future< replygetrange (const std::string &key, int start, int end)
 
clientgetset (const std::string &key, const std::string &val, const reply_callback_t &reply_callback)
 
std::future< replygetset (const std::string &key, const std::string &val)
 
clienthdel (const std::string &key, const std::vector< std::string > &fields, const reply_callback_t &reply_callback)
 
std::future< replyhdel (const std::string &key, const std::vector< std::string > &fields)
 
clienthexists (const std::string &key, const std::string &field, const reply_callback_t &reply_callback)
 
std::future< replyhexists (const std::string &key, const std::string &field)
 
clienthget (const std::string &key, const std::string &field, const reply_callback_t &reply_callback)
 
std::future< replyhget (const std::string &key, const std::string &field)
 
clienthgetall (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyhgetall (const std::string &key)
 
clienthincrby (const std::string &key, const std::string &field, int incr, const reply_callback_t &reply_callback)
 
std::future< replyhincrby (const std::string &key, const std::string &field, int incr)
 
clienthincrbyfloat (const std::string &key, const std::string &field, float incr, const reply_callback_t &reply_callback)
 
std::future< replyhincrbyfloat (const std::string &key, const std::string &field, float incr)
 
clienthkeys (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyhkeys (const std::string &key)
 
clienthlen (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyhlen (const std::string &key)
 
clienthmget (const std::string &key, const std::vector< std::string > &fields, const reply_callback_t &reply_callback)
 
std::future< replyhmget (const std::string &key, const std::vector< std::string > &fields)
 
clienthmset (const std::string &key, const std::vector< std::pair< std::string, std::string >> &field_val, const reply_callback_t &reply_callback)
 
std::future< replyhmset (const std::string &key, const std::vector< std::pair< std::string, std::string >> &field_val)
 
clienthset (const std::string &key, const std::string &field, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replyhset (const std::string &key, const std::string &field, const std::string &value)
 
clienthsetnx (const std::string &key, const std::string &field, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replyhsetnx (const std::string &key, const std::string &field, const std::string &value)
 
clienthstrlen (const std::string &key, const std::string &field, const reply_callback_t &reply_callback)
 
std::future< replyhstrlen (const std::string &key, const std::string &field)
 
clienthvals (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyhvals (const std::string &key)
 
clientincr (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyincr (const std::string &key)
 
clientincrby (const std::string &key, int incr, const reply_callback_t &reply_callback)
 
std::future< replyincrby (const std::string &key, int incr)
 
clientincrbyfloat (const std::string &key, float incr, const reply_callback_t &reply_callback)
 
std::future< replyincrbyfloat (const std::string &key, float incr)
 
clientinfo (const reply_callback_t &reply_callback)
 
clientinfo (const std::string &section, const reply_callback_t &reply_callback)
 
std::future< replyinfo (const std::string &section="default")
 
clientkeys (const std::string &pattern, const reply_callback_t &reply_callback)
 
std::future< replykeys (const std::string &pattern)
 
clientlastsave (const reply_callback_t &reply_callback)
 
std::future< replylastsave ()
 
clientlindex (const std::string &key, int index, const reply_callback_t &reply_callback)
 
std::future< replylindex (const std::string &key, int index)
 
clientlinsert (const std::string &key, const std::string &before_after, const std::string &pivot, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replylinsert (const std::string &key, const std::string &before_after, const std::string &pivot, const std::string &value)
 
clientllen (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyllen (const std::string &key)
 
clientlpop (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replylpop (const std::string &key)
 
clientlpush (const std::string &key, const std::vector< std::string > &values, const reply_callback_t &reply_callback)
 
std::future< replylpush (const std::string &key, const std::vector< std::string > &values)
 
clientlpushx (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replylpushx (const std::string &key, const std::string &value)
 
clientlrange (const std::string &key, int start, int stop, const reply_callback_t &reply_callback)
 
std::future< replylrange (const std::string &key, int start, int stop)
 
clientlrem (const std::string &key, int count, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replylrem (const std::string &key, int count, const std::string &value)
 
clientlset (const std::string &key, int index, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replylset (const std::string &key, int index, const std::string &value)
 
clientltrim (const std::string &key, int start, int stop, const reply_callback_t &reply_callback)
 
std::future< replyltrim (const std::string &key, int start, int stop)
 
clientmget (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replymget (const std::vector< std::string > &keys)
 
clientmigrate (const std::string &host, int port, const std::string &key, const std::string &dest_db, int timeout, const reply_callback_t &reply_callback)
 
clientmigrate (const std::string &host, int port, const std::string &key, const std::string &dest_db, int timeout, bool copy, bool replace, const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replymigrate (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={})
 
clientmonitor (const reply_callback_t &reply_callback)
 
std::future< replymonitor ()
 
clientmove (const std::string &key, const std::string &db, const reply_callback_t &reply_callback)
 
std::future< replymove (const std::string &key, const std::string &db)
 
clientmset (const std::vector< std::pair< std::string, std::string >> &key_vals, const reply_callback_t &reply_callback)
 
std::future< replymset (const std::vector< std::pair< std::string, std::string >> &key_vals)
 
clientmsetnx (const std::vector< std::pair< std::string, std::string >> &key_vals, const reply_callback_t &reply_callback)
 
std::future< replymsetnx (const std::vector< std::pair< std::string, std::string >> &key_vals)
 
clientmulti (const reply_callback_t &reply_callback)
 
std::future< replymulti ()
 
clientobject (const std::string &subcommand, const std::vector< std::string > &args, const reply_callback_t &reply_callback)
 
std::future< replyobject (const std::string &subcommand, const std::vector< std::string > &args)
 
clientpersist (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replypersist (const std::string &key)
 
clientpexpire (const std::string &key, int milliseconds, const reply_callback_t &reply_callback)
 
std::future< replypexpire (const std::string &key, int milliseconds)
 
clientpexpireat (const std::string &key, int milliseconds_timestamp, const reply_callback_t &reply_callback)
 
std::future< replypexpireat (const std::string &key, int milliseconds_timestamp)
 
clientpfadd (const std::string &key, const std::vector< std::string > &elements, const reply_callback_t &reply_callback)
 
std::future< replypfadd (const std::string &key, const std::vector< std::string > &elements)
 
clientpfcount (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replypfcount (const std::vector< std::string > &keys)
 
clientpfmerge (const std::string &destkey, const std::vector< std::string > &sourcekeys, const reply_callback_t &reply_callback)
 
std::future< replypfmerge (const std::string &destkey, const std::vector< std::string > &sourcekeys)
 
clientping (const reply_callback_t &reply_callback)
 
std::future< replyping ()
 
clientping (const std::string &message, const reply_callback_t &reply_callback)
 
std::future< replyping (const std::string &message)
 
clientpsetex (const std::string &key, int milliseconds, const std::string &val, const reply_callback_t &reply_callback)
 
std::future< replypsetex (const std::string &key, int milliseconds, const std::string &val)
 
clientpublish (const std::string &channel, const std::string &message, const reply_callback_t &reply_callback)
 
std::future< replypublish (const std::string &channel, const std::string &message)
 
clientpubsub (const std::string &subcommand, const std::vector< std::string > &args, const reply_callback_t &reply_callback)
 
std::future< replypubsub (const std::string &subcommand, const std::vector< std::string > &args)
 
clientpttl (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replypttl (const std::string &key)
 
clientquit (const reply_callback_t &reply_callback)
 
std::future< replyquit ()
 
clientrandomkey (const reply_callback_t &reply_callback)
 
std::future< replyrandomkey ()
 
clientreadonly (const reply_callback_t &reply_callback)
 
std::future< replyreadonly ()
 
clientreadwrite (const reply_callback_t &reply_callback)
 
std::future< replyreadwrite ()
 
clientrename (const std::string &key, const std::string &newkey, const reply_callback_t &reply_callback)
 
std::future< replyrename (const std::string &key, const std::string &newkey)
 
clientrenamenx (const std::string &key, const std::string &newkey, const reply_callback_t &reply_callback)
 
std::future< replyrenamenx (const std::string &key, const std::string &newkey)
 
clientrestore (const std::string &key, int ttl, const std::string &serialized_value, const reply_callback_t &reply_callback)
 
std::future< replyrestore (const std::string &key, int ttl, const std::string &serialized_value)
 
clientrestore (const std::string &key, int ttl, const std::string &serialized_value, const std::string &replace, const reply_callback_t &reply_callback)
 
std::future< replyrestore (const std::string &key, int ttl, const std::string &serialized_value, const std::string &replace)
 
clientrole (const reply_callback_t &reply_callback)
 
std::future< replyrole ()
 
clientrpop (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyrpop (const std::string &key)
 
clientrpoplpush (const std::string &source, const std::string &destination, const reply_callback_t &reply_callback)
 
std::future< replyrpoplpush (const std::string &src, const std::string &dst)
 
clientrpush (const std::string &key, const std::vector< std::string > &values, const reply_callback_t &reply_callback)
 
std::future< replyrpush (const std::string &key, const std::vector< std::string > &values)
 
clientrpushx (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replyrpushx (const std::string &key, const std::string &value)
 
clientsadd (const std::string &key, const std::vector< std::string > &members, const reply_callback_t &reply_callback)
 
std::future< replysadd (const std::string &key, const std::vector< std::string > &members)
 
clientsave (const reply_callback_t &reply_callback)
 
std::future< replysave ()
 
clientscan (int cursor, const std::string &pattern, int count, const reply_callback_t &reply_callback)
 
std::future< replyscan (int cursor, const std::string &pattern, int count)
 
clientscard (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyscard (const std::string &key)
 
clientscript_debug (const std::string &mode, const reply_callback_t &reply_callback)
 
std::future< replyscript_debug (const std::string &mode)
 
clientscript_exists (const std::vector< std::string > &scripts, const reply_callback_t &reply_callback)
 
std::future< replyscript_exists (const std::vector< std::string > &scripts)
 
clientscript_flush (const reply_callback_t &reply_callback)
 
std::future< replyscript_flush ()
 
clientscript_kill (const reply_callback_t &reply_callback)
 
std::future< replyscript_kill ()
 
clientscript_load (const std::string &script, const reply_callback_t &reply_callback)
 
std::future< replyscript_load (const std::string &script)
 
clientsdiff (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysdiff (const std::vector< std::string > &keys)
 
clientsdiffstore (const std::string &destination, const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysdiffstore (const std::string &dst, const std::vector< std::string > &keys)
 
clientselect (int index, const reply_callback_t &reply_callback)
 
std::future< replyselect (int index)
 
clientset (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replyset (const std::string &key, const std::string &value)
 
clientset_advanced (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
clientset_advanced (const std::string &key, const std::string &value, bool ex, int ex_sec, bool px, int px_milli, bool nx, bool xx, const reply_callback_t &reply_callback)
 
std::future< replyset_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)
 
clientsetbit_ (const std::string &key, int offset, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replysetbit_ (const std::string &key, int offset, const std::string &value)
 
clientsetex (const std::string &key, int seconds, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replysetex (const std::string &key, int seconds, const std::string &value)
 
clientsetnx (const std::string &key, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replysetnx (const std::string &key, const std::string &value)
 
clientsetrange (const std::string &key, int offset, const std::string &value, const reply_callback_t &reply_callback)
 
std::future< replysetrange (const std::string &key, int offset, const std::string &value)
 
clientshutdown (const reply_callback_t &reply_callback)
 
std::future< replyshutdown ()
 
clientshutdown (const std::string &save, const reply_callback_t &reply_callback)
 
std::future< replyshutdown (const std::string &save)
 
clientsinter (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysinter (const std::vector< std::string > &keys)
 
clientsinterstore (const std::string &destination, const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysinterstore (const std::string &dst, const std::vector< std::string > &keys)
 
clientsismember (const std::string &key, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replysismember (const std::string &key, const std::string &member)
 
clientslaveof (const std::string &host, int port, const reply_callback_t &reply_callback)
 
std::future< replyslaveof (const std::string &host, int port)
 
clientslowlog (const std::string subcommand, const reply_callback_t &reply_callback)
 
std::future< replyslowlog (const std::string &subcommand)
 
clientslowlog (const std::string subcommand, const std::string &argument, const reply_callback_t &reply_callback)
 
std::future< replyslowlog (const std::string &subcommand, const std::string &argument)
 
clientsmembers (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replysmembers (const std::string &key)
 
clientsmove (const std::string &source, const std::string &destination, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replysmove (const std::string &src, const std::string &dst, const std::string &member)
 
clientspop (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyspop (const std::string &key)
 
clientspop (const std::string &key, int count, const reply_callback_t &reply_callback)
 
std::future< replyspop (const std::string &key, int count)
 
clientsrandmember (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replysrandmember (const std::string &key)
 
clientsrandmember (const std::string &key, int count, const reply_callback_t &reply_callback)
 
std::future< replysrandmember (const std::string &key, int count)
 
clientsrem (const std::string &key, const std::vector< std::string > &members, const reply_callback_t &reply_callback)
 
std::future< replysrem (const std::string &key, const std::vector< std::string > &members)
 
clientstrlen (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replystrlen (const std::string &key)
 
clientsunion (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysunion (const std::vector< std::string > &keys)
 
clientsunionstore (const std::string &destination, const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replysunionstore (const std::string &dst, const std::vector< std::string > &keys)
 
clientsync (const reply_callback_t &reply_callback)
 
std::future< replysync ()
 
clienttime (const reply_callback_t &reply_callback)
 
std::future< replytime ()
 
clientttl (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyttl (const std::string &key)
 
clienttype (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replytype (const std::string &key)
 
clientunwatch (const reply_callback_t &reply_callback)
 
std::future< replyunwatch ()
 
clientwait (int numslaves, int timeout, const reply_callback_t &reply_callback)
 
std::future< replywait (int numslaves, int timeout)
 
clientwatch (const std::vector< std::string > &keys, const reply_callback_t &reply_callback)
 
std::future< replywatch (const std::vector< std::string > &keys)
 
clientzadd (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)
 
std::future< replyzadd (const std::string &key, const std::vector< std::string > &options, const std::map< std::string, std::string > &score_members)
 
clientzcard (const std::string &key, const reply_callback_t &reply_callback)
 
std::future< replyzcard (const std::string &key)
 
clientzcount (const std::string &key, int min, int max, const reply_callback_t &reply_callback)
 
std::future< replyzcount (const std::string &key, int min, int max)
 
clientzcount (const std::string &key, double min, double max, const reply_callback_t &reply_callback)
 
std::future< replyzcount (const std::string &key, double min, double max)
 
clientzcount (const std::string &key, const std::string &min, const std::string &max, const reply_callback_t &reply_callback)
 
std::future< replyzcount (const std::string &key, const std::string &min, const std::string &max)
 
clientzincrby (const std::string &key, int incr, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzincrby (const std::string &key, int incr, const std::string &member)
 
clientzincrby (const std::string &key, double incr, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzincrby (const std::string &key, double incr, const std::string &member)
 
clientzincrby (const std::string &key, const std::string &incr, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzincrby (const std::string &key, const std::string &incr, const std::string &member)
 
clientzlexcount (const std::string &key, int min, int max, const reply_callback_t &reply_callback)
 
std::future< replyzlexcount (const std::string &key, int min, int max)
 
clientzlexcount (const std::string &key, double min, double max, const reply_callback_t &reply_callback)
 
std::future< replyzlexcount (const std::string &key, double min, double max)
 
clientzlexcount (const std::string &key, const std::string &min, const std::string &max, const reply_callback_t &reply_callback)
 
std::future< replyzlexcount (const std::string &key, const std::string &min, const std::string &max)
 
clientzrange (const std::string &key, int start, int stop, const reply_callback_t &reply_callback)
 
clientzrange (const std::string &key, int start, int stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrange (const std::string &key, int start, int stop, bool withscores=false)
 
clientzrange (const std::string &key, double start, double stop, const reply_callback_t &reply_callback)
 
clientzrange (const std::string &key, double start, double stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrange (const std::string &key, double start, double stop, bool withscores=false)
 
clientzrange (const std::string &key, const std::string &start, const std::string &stop, const reply_callback_t &reply_callback)
 
clientzrange (const std::string &key, const std::string &start, const std::string &stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrange (const std::string &key, const std::string &start, const std::string &stop, bool withscores=false)
 
clientzrank (const std::string &key, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzrank (const std::string &key, const std::string &member)
 
clientzrem (const std::string &key, const std::vector< std::string > &members, const reply_callback_t &reply_callback)
 
std::future< replyzrem (const std::string &key, const std::vector< std::string > &members)
 
clientzremrangebylex (const std::string &key, int min, int max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebylex (const std::string &key, int min, int max)
 
clientzremrangebylex (const std::string &key, double min, double max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebylex (const std::string &key, double min, double max)
 
clientzremrangebylex (const std::string &key, const std::string &min, const std::string &max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebylex (const std::string &key, const std::string &min, const std::string &max)
 
clientzremrangebyrank (const std::string &key, int start, int stop, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyrank (const std::string &key, int start, int stop)
 
clientzremrangebyrank (const std::string &key, double start, double stop, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyrank (const std::string &key, double start, double stop)
 
clientzremrangebyrank (const std::string &key, const std::string &start, const std::string &stop, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyrank (const std::string &key, const std::string &start, const std::string &stop)
 
clientzremrangebyscore (const std::string &key, int min, int max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyscore (const std::string &key, int min, int max)
 
clientzremrangebyscore (const std::string &key, double min, double max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyscore (const std::string &key, double min, double max)
 
clientzremrangebyscore (const std::string &key, const std::string &min, const std::string &max, const reply_callback_t &reply_callback)
 
std::future< replyzremrangebyscore (const std::string &key, const std::string &min, const std::string &max)
 
clientzrevrange (const std::string &key, int start, int stop, const reply_callback_t &reply_callback)
 
clientzrevrange (const std::string &key, int start, int stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrevrange (const std::string &key, int start, int stop, bool withscores=false)
 
clientzrevrange (const std::string &key, double start, double stop, const reply_callback_t &reply_callback)
 
clientzrevrange (const std::string &key, double start, double stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrevrange (const std::string &key, double start, double stop, bool withscores=false)
 
clientzrevrange (const std::string &key, const std::string &start, const std::string &stop, const reply_callback_t &reply_callback)
 
clientzrevrange (const std::string &key, const std::string &start, const std::string &stop, bool withscores, const reply_callback_t &reply_callback)
 
std::future< replyzrevrange (const std::string &key, const std::string &start, const std::string &stop, bool withscores=false)
 
clientzrevrank (const std::string &key, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzrevrank (const std::string &key, const std::string &member)
 
clientzscore (const std::string &key, const std::string &member, const reply_callback_t &reply_callback)
 
std::future< replyzscore (const std::string &key, const std::string &member)
 
template<typename T, typename... Ts>
clientclient_kill (const T &arg, const Ts &... args)
 

Private Member Functions

bool should_reconnect (void) const
 
void resend_failed_commands (void)
 
void sleep_before_next_reconnect_attempt (void)
 
void reconnect (void)
 
void re_auth (void)
 
void re_select (void)
 
void unprotected_send (const std::vector< std::string > &redis_cmd, const reply_callback_t &callback)
 
void unprotected_auth (const std::string &password, const reply_callback_t &reply_callback)
 
void unprotected_select (int index, const reply_callback_t &reply_callback)
 
template<typename T >
std::enable_if< std::is_same< T, client_type >::value >::type client_kill_unpack_arg (std::vector< std::string > &redis_cmd, reply_callback_t &, client_type type)
 client kill impl More...
 
template<typename T >
std::enable_if< std::is_same< T, bool >::value >::type client_kill_unpack_arg (std::vector< std::string > &redis_cmd, reply_callback_t &, bool skip)
 
template<typename T >
std::enable_if< std::is_integral< T >::value >::type client_kill_unpack_arg (std::vector< std::string > &redis_cmd, reply_callback_t &, uint64_t id)
 
template<typename T >
std::enable_if< std::is_class< T >::value >::type client_kill_unpack_arg (std::vector< std::string > &, reply_callback_t &reply_callback, const T &cb)
 
template<typename T , typename... Ts>
void client_kill_impl (std::vector< std::string > &redis_cmd, reply_callback_t &reply, const T &arg, const Ts &... args)
 
template<typename T >
void client_kill_impl (std::vector< std::string > &redis_cmd, reply_callback_t &reply, const T &arg)
 
void connection_receive_handler (network::redis_connection &connection, reply &reply)
 
void connection_disconnection_handler (network::redis_connection &connection)
 
void clear_callbacks (void)
 
void try_commit (void)
 
std::future< replyexec_cmd (const std::function< client &(const reply_callback_t &)> &f)
 Execute a command on the client and tie the callback to a future. More...
 

Private Attributes

std::string m_redis_server
 
std::size_t m_redis_port = 0
 
std::string m_master_name
 
std::string m_password
 
int m_database_index = 0
 
network::redis_connection m_client
 
cpp_redis::sentinel m_sentinel
 
std::uint32_t m_connect_timeout_msecs = 0
 
std::int32_t m_max_reconnects = 0
 
std::int32_t m_current_reconnect_attempts = 0
 
std::uint32_t m_reconnect_interval_msecs = 0
 
std::atomic_bool m_reconnecting = ATOMIC_VAR_INIT(false)
 
std::atomic_bool m_cancel = ATOMIC_VAR_INIT(false)
 
std::queue< command_requestm_commands
 
connect_callback_t m_connect_callback
 
std::mutex m_callbacks_mutex
 
std::condition_variable m_sync_condvar
 
std::atomic< unsigned int > m_callbacks_running = ATOMIC_VAR_INIT(0)
 

Member Typedef Documentation

◆ connect_callback_t

typedef std::function<void(const std::string& host, std::size_t port, connect_state status)> cpp_redis::client::connect_callback_t

connect handler, called whenever a new connection even occurred

◆ reply_callback_t

typedef std::function<void(reply&)> cpp_redis::client::reply_callback_t

reply callback called whenever a reply is received takes as parameter the received reply

Member Enumeration Documentation

◆ client_type

client type used for client kill

Enumerator
normal 
master 
pubsub 
slave 

◆ connect_state

high availability (re)connection states

  • dropped: connection has dropped
  • start: attemp of connection has started
  • sleeping: sleep between two attemps
  • ok: connected
  • failed: failed to connect
  • lookup failed: failed to retrieve master sentinel
  • stopped: stop to try to reconnect
Enumerator
dropped 
start 
sleeping 
ok 
failed 
lookup_failed 
stopped 

Constructor & Destructor Documentation

◆ client() [1/3]

cpp_redis::client::client ( void  )

ctor

◆ client() [2/3]

cpp_redis::client::client ( const std::shared_ptr< network::tcp_client_iface > &  tcp_client)
explicit

custom ctor to specify custom tcp_client

Parameters
tcp_clienttcp client to be used for network communications

◆ ~client()

cpp_redis::client::~client ( void  )

dtor

◆ client() [3/3]

cpp_redis::client::client ( const client )
delete

copy ctor

Member Function Documentation

◆ add_sentinel()

void cpp_redis::client::add_sentinel ( const std::string &  host,
std::size_t  port 
)

add a sentinel definition. Required for connect() or get_master_addr_by_name() when autoconnect is enabled.

Parameters
hostsentinel host
portsentinel port

◆ append() [1/2]

client& cpp_redis::client::append ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ append() [2/2]

std::future<reply> cpp_redis::client::append ( const std::string &  key,
const std::string &  value 
)

◆ auth() [1/2]

client& cpp_redis::client::auth ( const std::string &  password,
const reply_callback_t reply_callback 
)

◆ auth() [2/2]

std::future<reply> cpp_redis::client::auth ( const std::string &  password)

◆ bgrewriteaof() [1/2]

client& cpp_redis::client::bgrewriteaof ( const reply_callback_t reply_callback)

◆ bgrewriteaof() [2/2]

std::future<reply> cpp_redis::client::bgrewriteaof ( )

◆ bgsave() [1/2]

client& cpp_redis::client::bgsave ( const reply_callback_t reply_callback)

◆ bgsave() [2/2]

std::future<reply> cpp_redis::client::bgsave ( )

◆ bitcount() [1/4]

client& cpp_redis::client::bitcount ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ bitcount() [2/4]

std::future<reply> cpp_redis::client::bitcount ( const std::string &  key)

◆ bitcount() [3/4]

client& cpp_redis::client::bitcount ( const std::string &  key,
int  start,
int  end,
const reply_callback_t reply_callback 
)

◆ bitcount() [4/4]

std::future<reply> cpp_redis::client::bitcount ( const std::string &  key,
int  start,
int  end 
)

◆ bitop() [1/2]

client& cpp_redis::client::bitop ( const std::string &  operation,
const std::string &  destkey,
const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ bitop() [2/2]

std::future<reply> cpp_redis::client::bitop ( const std::string &  operation,
const std::string &  destkey,
const std::vector< std::string > &  keys 
)

◆ bitpos() [1/6]

client& cpp_redis::client::bitpos ( const std::string &  key,
int  bit,
const reply_callback_t reply_callback 
)

◆ bitpos() [2/6]

std::future<reply> cpp_redis::client::bitpos ( const std::string &  key,
int  bit 
)

◆ bitpos() [3/6]

client& cpp_redis::client::bitpos ( const std::string &  key,
int  bit,
int  start,
const reply_callback_t reply_callback 
)

◆ bitpos() [4/6]

std::future<reply> cpp_redis::client::bitpos ( const std::string &  key,
int  bit,
int  start 
)

◆ bitpos() [5/6]

client& cpp_redis::client::bitpos ( const std::string &  key,
int  bit,
int  start,
int  end,
const reply_callback_t reply_callback 
)

◆ bitpos() [6/6]

std::future<reply> cpp_redis::client::bitpos ( const std::string &  key,
int  bit,
int  start,
int  end 
)

◆ blpop() [1/2]

client& cpp_redis::client::blpop ( const std::vector< std::string > &  keys,
int  timeout,
const reply_callback_t reply_callback 
)

◆ blpop() [2/2]

std::future<reply> cpp_redis::client::blpop ( const std::vector< std::string > &  keys,
int  timeout 
)

◆ brpop() [1/2]

client& cpp_redis::client::brpop ( const std::vector< std::string > &  keys,
int  timeout,
const reply_callback_t reply_callback 
)

◆ brpop() [2/2]

std::future<reply> cpp_redis::client::brpop ( const std::vector< std::string > &  keys,
int  timeout 
)

◆ brpoplpush() [1/2]

client& cpp_redis::client::brpoplpush ( const std::string &  src,
const std::string &  dst,
int  timeout,
const reply_callback_t reply_callback 
)

◆ brpoplpush() [2/2]

std::future<reply> cpp_redis::client::brpoplpush ( const std::string &  src,
const std::string &  dst,
int  timeout 
)

◆ cancel_reconnect()

void cpp_redis::client::cancel_reconnect ( void  )

stop any reconnect in progress

◆ clear_callbacks()

void cpp_redis::client::clear_callbacks ( void  )
private

reset the queue of pending callbacks

◆ clear_sentinels()

void cpp_redis::client::clear_sentinels ( void  )

clear all existing sentinels.

◆ client_getname() [1/2]

client& cpp_redis::client::client_getname ( const reply_callback_t reply_callback)

◆ client_getname() [2/2]

std::future<reply> cpp_redis::client::client_getname ( )

◆ client_kill() [1/5]

template<typename T, typename... Ts>
client& cpp_redis::client::client_kill ( const T &  arg,
const Ts &...  args 
)
inline

◆ client_kill() [2/5]

template<typename T , typename... Ts>
client & cpp_redis::client::client_kill ( const std::string &  host,
int  port,
const T &  arg,
const Ts &...  args 
)
inline

If we have other type than lambda, then it's a filter

◆ client_kill() [3/5]

client & cpp_redis::client::client_kill ( const std::string &  host,
int  port 
)
inline

◆ client_kill() [4/5]

template<typename... Ts>
client & cpp_redis::client::client_kill ( const char *  host,
int  port,
const Ts &...  args 
)
inline

◆ client_kill() [5/5]

template<typename T , typename... Ts>
client& cpp_redis::client::client_kill ( const T &  ,
const Ts &  ... 
)

◆ client_kill_future()

template<typename T , typename... Ts>
std::future< reply > cpp_redis::client::client_kill_future ( const T  arg,
const Ts...  args 
)

gcc 4.8 doesn't handle variadic template capture arguments (appears in 4.9) so std::bind should capture all arguments because of the compiler.

◆ client_kill_impl() [1/2]

template<typename T , typename... Ts>
void cpp_redis::client::client_kill_impl ( std::vector< std::string > &  redis_cmd,
reply_callback_t reply,
const T &  arg,
const Ts &...  args 
)
private

◆ client_kill_impl() [2/2]

template<typename T >
void cpp_redis::client::client_kill_impl ( std::vector< std::string > &  redis_cmd,
reply_callback_t reply,
const T &  arg 
)
private

◆ client_kill_unpack_arg() [1/4]

template<typename T >
std::enable_if< std::is_same< T, client::client_type >::value >::type cpp_redis::client::client_kill_unpack_arg ( std::vector< std::string > &  redis_cmd,
reply_callback_t ,
client_type  type 
)
private

client kill impl

◆ client_kill_unpack_arg() [2/4]

template<typename T >
std::enable_if< std::is_same< T, bool >::value >::type cpp_redis::client::client_kill_unpack_arg ( std::vector< std::string > &  redis_cmd,
reply_callback_t ,
bool  skip 
)
private

◆ client_kill_unpack_arg() [3/4]

template<typename T >
std::enable_if< std::is_integral< T >::value >::type cpp_redis::client::client_kill_unpack_arg ( std::vector< std::string > &  redis_cmd,
reply_callback_t ,
uint64_t  id 
)
private

◆ client_kill_unpack_arg() [4/4]

template<typename T >
std::enable_if< std::is_class< T >::value >::type cpp_redis::client::client_kill_unpack_arg ( std::vector< std::string > &  ,
reply_callback_t reply_callback,
const T &  cb 
)
private

◆ client_list() [1/2]

client& cpp_redis::client::client_list ( const reply_callback_t reply_callback)

◆ client_list() [2/2]

std::future<reply> cpp_redis::client::client_list ( )

◆ client_pause() [1/2]

client& cpp_redis::client::client_pause ( int  timeout,
const reply_callback_t reply_callback 
)

◆ client_pause() [2/2]

std::future<reply> cpp_redis::client::client_pause ( int  timeout)

◆ client_reply() [1/2]

client& cpp_redis::client::client_reply ( const std::string &  mode,
const reply_callback_t reply_callback 
)

◆ client_reply() [2/2]

std::future<reply> cpp_redis::client::client_reply ( const std::string &  mode)

◆ client_setname() [1/2]

client& cpp_redis::client::client_setname ( const std::string &  name,
const reply_callback_t reply_callback 
)

◆ client_setname() [2/2]

std::future<reply> cpp_redis::client::client_setname ( const std::string &  name)

◆ cluster_addslots() [1/2]

client& cpp_redis::client::cluster_addslots ( const std::vector< std::string > &  p_slots,
const reply_callback_t reply_callback 
)

◆ cluster_addslots() [2/2]

std::future<reply> cpp_redis::client::cluster_addslots ( const std::vector< std::string > &  p_slots)

◆ cluster_count_failure_reports() [1/2]

client& cpp_redis::client::cluster_count_failure_reports ( const std::string &  node_id,
const reply_callback_t reply_callback 
)

◆ cluster_count_failure_reports() [2/2]

std::future<reply> cpp_redis::client::cluster_count_failure_reports ( const std::string &  node_id)

◆ cluster_countkeysinslot() [1/2]

client& cpp_redis::client::cluster_countkeysinslot ( const std::string &  slot,
const reply_callback_t reply_callback 
)

◆ cluster_countkeysinslot() [2/2]

std::future<reply> cpp_redis::client::cluster_countkeysinslot ( const std::string &  slot)

◆ cluster_delslots() [1/2]

client& cpp_redis::client::cluster_delslots ( const std::vector< std::string > &  p_slots,
const reply_callback_t reply_callback 
)

◆ cluster_delslots() [2/2]

std::future<reply> cpp_redis::client::cluster_delslots ( const std::vector< std::string > &  p_slots)

◆ cluster_failover() [1/4]

client& cpp_redis::client::cluster_failover ( const reply_callback_t reply_callback)

◆ cluster_failover() [2/4]

std::future<reply> cpp_redis::client::cluster_failover ( )

◆ cluster_failover() [3/4]

client& cpp_redis::client::cluster_failover ( const std::string &  mode,
const reply_callback_t reply_callback 
)

◆ cluster_failover() [4/4]

std::future<reply> cpp_redis::client::cluster_failover ( const std::string &  mode)

◆ cluster_forget() [1/2]

client& cpp_redis::client::cluster_forget ( const std::string &  node_id,
const reply_callback_t reply_callback 
)

◆ cluster_forget() [2/2]

std::future<reply> cpp_redis::client::cluster_forget ( const std::string &  node_id)

◆ cluster_getkeysinslot() [1/2]

client& cpp_redis::client::cluster_getkeysinslot ( const std::string &  slot,
int  count,
const reply_callback_t reply_callback 
)

◆ cluster_getkeysinslot() [2/2]

std::future<reply> cpp_redis::client::cluster_getkeysinslot ( const std::string &  slot,
int  count 
)

◆ cluster_info() [1/2]

client& cpp_redis::client::cluster_info ( const reply_callback_t reply_callback)

◆ cluster_info() [2/2]

std::future<reply> cpp_redis::client::cluster_info ( )

◆ cluster_keyslot() [1/2]

client& cpp_redis::client::cluster_keyslot ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ cluster_keyslot() [2/2]

std::future<reply> cpp_redis::client::cluster_keyslot ( const std::string &  key)

◆ cluster_meet() [1/2]

client& cpp_redis::client::cluster_meet ( const std::string &  ip,
int  port,
const reply_callback_t reply_callback 
)

◆ cluster_meet() [2/2]

std::future<reply> cpp_redis::client::cluster_meet ( const std::string &  ip,
int  port 
)

◆ cluster_nodes() [1/2]

client& cpp_redis::client::cluster_nodes ( const reply_callback_t reply_callback)

◆ cluster_nodes() [2/2]

std::future<reply> cpp_redis::client::cluster_nodes ( )

◆ cluster_replicate() [1/2]

client& cpp_redis::client::cluster_replicate ( const std::string &  node_id,
const reply_callback_t reply_callback 
)

◆ cluster_replicate() [2/2]

std::future<reply> cpp_redis::client::cluster_replicate ( const std::string &  node_id)

◆ cluster_reset() [1/3]

client& cpp_redis::client::cluster_reset ( const reply_callback_t reply_callback)

◆ cluster_reset() [2/3]

client& cpp_redis::client::cluster_reset ( const std::string &  mode,
const reply_callback_t reply_callback 
)

◆ cluster_reset() [3/3]

std::future<reply> cpp_redis::client::cluster_reset ( const std::string &  mode = "soft")

◆ cluster_saveconfig() [1/2]

client& cpp_redis::client::cluster_saveconfig ( const reply_callback_t reply_callback)

◆ cluster_saveconfig() [2/2]

std::future<reply> cpp_redis::client::cluster_saveconfig ( )

◆ cluster_set_config_epoch() [1/2]

client& cpp_redis::client::cluster_set_config_epoch ( const std::string &  epoch,
const reply_callback_t reply_callback 
)

◆ cluster_set_config_epoch() [2/2]

std::future<reply> cpp_redis::client::cluster_set_config_epoch ( const std::string &  epoch)

◆ cluster_setslot() [1/4]

client& cpp_redis::client::cluster_setslot ( const std::string &  slot,
const std::string &  mode,
const reply_callback_t reply_callback 
)

◆ cluster_setslot() [2/4]

std::future<reply> cpp_redis::client::cluster_setslot ( const std::string &  slot,
const std::string &  mode 
)

◆ cluster_setslot() [3/4]

client& cpp_redis::client::cluster_setslot ( const std::string &  slot,
const std::string &  mode,
const std::string &  node_id,
const reply_callback_t reply_callback 
)

◆ cluster_setslot() [4/4]

std::future<reply> cpp_redis::client::cluster_setslot ( const std::string &  slot,
const std::string &  mode,
const std::string &  node_id 
)

◆ cluster_slaves() [1/2]

client& cpp_redis::client::cluster_slaves ( const std::string &  node_id,
const reply_callback_t reply_callback 
)

◆ cluster_slaves() [2/2]

std::future<reply> cpp_redis::client::cluster_slaves ( const std::string &  node_id)

◆ cluster_slots() [1/2]

client& cpp_redis::client::cluster_slots ( const reply_callback_t reply_callback)

◆ cluster_slots() [2/2]

std::future<reply> cpp_redis::client::cluster_slots ( )

◆ command() [1/2]

client& cpp_redis::client::command ( const reply_callback_t reply_callback)

◆ command() [2/2]

std::future<reply> cpp_redis::client::command ( )

◆ command_count() [1/2]

client& cpp_redis::client::command_count ( const reply_callback_t reply_callback)

◆ command_count() [2/2]

std::future<reply> cpp_redis::client::command_count ( )

◆ command_getkeys() [1/2]

client& cpp_redis::client::command_getkeys ( const reply_callback_t reply_callback)

◆ command_getkeys() [2/2]

std::future<reply> cpp_redis::client::command_getkeys ( )

◆ command_info() [1/2]

client& cpp_redis::client::command_info ( const std::vector< std::string > &  command_name,
const reply_callback_t reply_callback 
)

◆ command_info() [2/2]

std::future<reply> cpp_redis::client::command_info ( const std::vector< std::string > &  command_name)

◆ commit()

client& cpp_redis::client::commit ( void  )

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.

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.

◆ config_get() [1/2]

client& cpp_redis::client::config_get ( const std::string &  param,
const reply_callback_t reply_callback 
)

◆ config_get() [2/2]

std::future<reply> cpp_redis::client::config_get ( const std::string &  param)

◆ config_resetstat() [1/2]

client& cpp_redis::client::config_resetstat ( const reply_callback_t reply_callback)

◆ config_resetstat() [2/2]

std::future<reply> cpp_redis::client::config_resetstat ( )

◆ config_rewrite() [1/2]

client& cpp_redis::client::config_rewrite ( const reply_callback_t reply_callback)

◆ config_rewrite() [2/2]

std::future<reply> cpp_redis::client::config_rewrite ( )

◆ config_set() [1/2]

client& cpp_redis::client::config_set ( const std::string &  param,
const std::string &  val,
const reply_callback_t reply_callback 
)

◆ config_set() [2/2]

std::future<reply> cpp_redis::client::config_set ( const std::string &  param,
const std::string &  val 
)

◆ connect() [1/2]

void cpp_redis::client::connect ( const std::string &  host = "127.0.0.1",
std::size_t  port = 6379,
const connect_callback_t connect_callback = nullptr,
std::uint32_t  timeout_msecs = 0,
std::int32_t  max_reconnects = 0,
std::uint32_t  reconnect_interval_msecs = 0 
)

Connect to redis server

Parameters
hosthost to be connected to
portport to be connected to
connect_callbackconnect handler to be called on connect events (may be null)
timeout_msecsmaximum time to connect
max_reconnectsmaximum attemps of reconnection if connection dropped
reconnect_interval_msecstime between two attemps of reconnection

◆ connect() [2/2]

void cpp_redis::client::connect ( const std::string &  name,
const connect_callback_t connect_callback = nullptr,
std::uint32_t  timeout_msecs = 0,
std::int32_t  max_reconnects = 0,
std::uint32_t  reconnect_interval_msecs = 0 
)

Connect to redis server

Parameters
namesentinel name
connect_callbackconnect handler to be called on connect events (may be null)
timeout_msecsmaximum time to connect
max_reconnectsmaximum attemps of reconnection if connection dropped
reconnect_interval_msecstime between two attemps of reconnection

◆ connection_disconnection_handler()

void cpp_redis::client::connection_disconnection_handler ( network::redis_connection connection)
private

redis_connection disconnection handler, triggered whenever a disconnection occured

Parameters
connectionredis_connection instance

◆ connection_receive_handler()

void cpp_redis::client::connection_receive_handler ( network::redis_connection connection,
reply reply 
)
private

redis connection receive handler, triggered whenever a reply has been read by the redis connection

Parameters
connectionredis_connection instance
replyparsed reply

◆ dbsize() [1/2]

client& cpp_redis::client::dbsize ( const reply_callback_t reply_callback)

◆ dbsize() [2/2]

std::future<reply> cpp_redis::client::dbsize ( )

◆ debug_object() [1/2]

client& cpp_redis::client::debug_object ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ debug_object() [2/2]

std::future<reply> cpp_redis::client::debug_object ( const std::string &  key)

◆ debug_segfault() [1/2]

client& cpp_redis::client::debug_segfault ( const reply_callback_t reply_callback)

◆ debug_segfault() [2/2]

std::future<reply> cpp_redis::client::debug_segfault ( )

◆ decr() [1/2]

client& cpp_redis::client::decr ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ decr() [2/2]

std::future<reply> cpp_redis::client::decr ( const std::string &  key)

◆ decrby() [1/2]

client& cpp_redis::client::decrby ( const std::string &  key,
int  val,
const reply_callback_t reply_callback 
)

◆ decrby() [2/2]

std::future<reply> cpp_redis::client::decrby ( const std::string &  key,
int  val 
)

◆ del() [1/2]

client& cpp_redis::client::del ( const std::vector< std::string > &  key,
const reply_callback_t reply_callback 
)

◆ del() [2/2]

std::future<reply> cpp_redis::client::del ( const std::vector< std::string > &  key)

◆ discard() [1/2]

client& cpp_redis::client::discard ( const reply_callback_t reply_callback)

◆ discard() [2/2]

std::future<reply> cpp_redis::client::discard ( )

◆ disconnect()

void cpp_redis::client::disconnect ( bool  wait_for_removal = false)

disconnect from redis server

Parameters
wait_for_removalwhen 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.

◆ dump() [1/2]

client& cpp_redis::client::dump ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ dump() [2/2]

std::future<reply> cpp_redis::client::dump ( const std::string &  key)

◆ echo() [1/2]

client& cpp_redis::client::echo ( const std::string &  msg,
const reply_callback_t reply_callback 
)

◆ echo() [2/2]

std::future<reply> cpp_redis::client::echo ( const std::string &  msg)

◆ eval() [1/2]

client& cpp_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 
)

◆ eval() [2/2]

std::future<reply> cpp_redis::client::eval ( const std::string &  script,
int  numkeys,
const std::vector< std::string > &  keys,
const std::vector< std::string > &  args 
)

◆ evalsha() [1/2]

client& cpp_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 
)

◆ evalsha() [2/2]

std::future<reply> cpp_redis::client::evalsha ( const std::string &  sha1,
int  numkeys,
const std::vector< std::string > &  keys,
const std::vector< std::string > &  args 
)

◆ exec() [1/2]

client& cpp_redis::client::exec ( const reply_callback_t reply_callback)

◆ exec() [2/2]

std::future<reply> cpp_redis::client::exec ( )

◆ exec_cmd()

std::future<reply> cpp_redis::client::exec_cmd ( const std::function< client &(const reply_callback_t &)> &  f)
private

Execute a command on the client and tie the callback to a future.

◆ exists() [1/2]

client& cpp_redis::client::exists ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ exists() [2/2]

std::future<reply> cpp_redis::client::exists ( const std::vector< std::string > &  keys)

◆ expire() [1/2]

client& cpp_redis::client::expire ( const std::string &  key,
int  seconds,
const reply_callback_t reply_callback 
)

◆ expire() [2/2]

std::future<reply> cpp_redis::client::expire ( const std::string &  key,
int  seconds 
)

◆ expireat() [1/2]

client& cpp_redis::client::expireat ( const std::string &  key,
int  timestamp,
const reply_callback_t reply_callback 
)

◆ expireat() [2/2]

std::future<reply> cpp_redis::client::expireat ( const std::string &  key,
int  timestamp 
)

◆ flushall() [1/2]

client& cpp_redis::client::flushall ( const reply_callback_t reply_callback)

◆ flushall() [2/2]

std::future<reply> cpp_redis::client::flushall ( )

◆ flushdb() [1/2]

client& cpp_redis::client::flushdb ( const reply_callback_t reply_callback)

◆ flushdb() [2/2]

std::future<reply> cpp_redis::client::flushdb ( )

◆ geoadd() [1/2]

client& cpp_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 
)

◆ geoadd() [2/2]

std::future<reply> cpp_redis::client::geoadd ( const std::string &  key,
const std::vector< std::tuple< std::string, std::string, std::string >> &  long_lat_memb 
)

◆ geodist() [1/3]

client& cpp_redis::client::geodist ( const std::string &  key,
const std::string &  member_1,
const std::string &  member_2,
const reply_callback_t reply_callback 
)

◆ geodist() [2/3]

client& cpp_redis::client::geodist ( const std::string &  key,
const std::string &  member_1,
const std::string &  member_2,
const std::string &  unit,
const reply_callback_t reply_callback 
)

◆ geodist() [3/3]

std::future<reply> cpp_redis::client::geodist ( const std::string &  key,
const std::string &  member_1,
const std::string &  member_2,
const std::string &  unit = "m" 
)

◆ geohash() [1/2]

client& cpp_redis::client::geohash ( const std::string &  key,
const std::vector< std::string > &  members,
const reply_callback_t reply_callback 
)

◆ geohash() [2/2]

std::future<reply> cpp_redis::client::geohash ( const std::string &  key,
const std::vector< std::string > &  members 
)

◆ geopos() [1/2]

client& cpp_redis::client::geopos ( const std::string &  key,
const std::vector< std::string > &  members,
const reply_callback_t reply_callback 
)

◆ geopos() [2/2]

std::future<reply> cpp_redis::client::geopos ( const std::string &  key,
const std::vector< std::string > &  members 
)

◆ get() [1/2]

client& cpp_redis::client::get ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ get() [2/2]

std::future<reply> cpp_redis::client::get ( const std::string &  key)

◆ get_sentinel() [1/2]

const sentinel& cpp_redis::client::get_sentinel ( void  ) const

retrieve sentinel for current client

Returns
sentinel associated to current client

◆ get_sentinel() [2/2]

sentinel& cpp_redis::client::get_sentinel ( void  )

retrieve sentinel for current client non-const version

Returns
sentinel associated to current client

◆ getbit() [1/2]

client& cpp_redis::client::getbit ( const std::string &  key,
int  offset,
const reply_callback_t reply_callback 
)

◆ getbit() [2/2]

std::future<reply> cpp_redis::client::getbit ( const std::string &  key,
int  offset 
)

◆ getrange() [1/2]

client& cpp_redis::client::getrange ( const std::string &  key,
int  start,
int  end,
const reply_callback_t reply_callback 
)

◆ getrange() [2/2]

std::future<reply> cpp_redis::client::getrange ( const std::string &  key,
int  start,
int  end 
)

◆ getset() [1/2]

client& cpp_redis::client::getset ( const std::string &  key,
const std::string &  val,
const reply_callback_t reply_callback 
)

◆ getset() [2/2]

std::future<reply> cpp_redis::client::getset ( const std::string &  key,
const std::string &  val 
)

◆ hdel() [1/2]

client& cpp_redis::client::hdel ( const std::string &  key,
const std::vector< std::string > &  fields,
const reply_callback_t reply_callback 
)

◆ hdel() [2/2]

std::future<reply> cpp_redis::client::hdel ( const std::string &  key,
const std::vector< std::string > &  fields 
)

◆ hexists() [1/2]

client& cpp_redis::client::hexists ( const std::string &  key,
const std::string &  field,
const reply_callback_t reply_callback 
)

◆ hexists() [2/2]

std::future<reply> cpp_redis::client::hexists ( const std::string &  key,
const std::string &  field 
)

◆ hget() [1/2]

client& cpp_redis::client::hget ( const std::string &  key,
const std::string &  field,
const reply_callback_t reply_callback 
)

◆ hget() [2/2]

std::future<reply> cpp_redis::client::hget ( const std::string &  key,
const std::string &  field 
)

◆ hgetall() [1/2]

client& cpp_redis::client::hgetall ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ hgetall() [2/2]

std::future<reply> cpp_redis::client::hgetall ( const std::string &  key)

◆ hincrby() [1/2]

client& cpp_redis::client::hincrby ( const std::string &  key,
const std::string &  field,
int  incr,
const reply_callback_t reply_callback 
)

◆ hincrby() [2/2]

std::future<reply> cpp_redis::client::hincrby ( const std::string &  key,
const std::string &  field,
int  incr 
)

◆ hincrbyfloat() [1/2]

client& cpp_redis::client::hincrbyfloat ( const std::string &  key,
const std::string &  field,
float  incr,
const reply_callback_t reply_callback 
)

◆ hincrbyfloat() [2/2]

std::future<reply> cpp_redis::client::hincrbyfloat ( const std::string &  key,
const std::string &  field,
float  incr 
)

◆ hkeys() [1/2]

client& cpp_redis::client::hkeys ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ hkeys() [2/2]

std::future<reply> cpp_redis::client::hkeys ( const std::string &  key)

◆ hlen() [1/2]

client& cpp_redis::client::hlen ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ hlen() [2/2]

std::future<reply> cpp_redis::client::hlen ( const std::string &  key)

◆ hmget() [1/2]

client& cpp_redis::client::hmget ( const std::string &  key,
const std::vector< std::string > &  fields,
const reply_callback_t reply_callback 
)

◆ hmget() [2/2]

std::future<reply> cpp_redis::client::hmget ( const std::string &  key,
const std::vector< std::string > &  fields 
)

◆ hmset() [1/2]

client& cpp_redis::client::hmset ( const std::string &  key,
const std::vector< std::pair< std::string, std::string >> &  field_val,
const reply_callback_t reply_callback 
)

◆ hmset() [2/2]

std::future<reply> cpp_redis::client::hmset ( const std::string &  key,
const std::vector< std::pair< std::string, std::string >> &  field_val 
)

◆ hset() [1/2]

client& cpp_redis::client::hset ( const std::string &  key,
const std::string &  field,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ hset() [2/2]

std::future<reply> cpp_redis::client::hset ( const std::string &  key,
const std::string &  field,
const std::string &  value 
)

◆ hsetnx() [1/2]

client& cpp_redis::client::hsetnx ( const std::string &  key,
const std::string &  field,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ hsetnx() [2/2]

std::future<reply> cpp_redis::client::hsetnx ( const std::string &  key,
const std::string &  field,
const std::string &  value 
)

◆ hstrlen() [1/2]

client& cpp_redis::client::hstrlen ( const std::string &  key,
const std::string &  field,
const reply_callback_t reply_callback 
)

◆ hstrlen() [2/2]

std::future<reply> cpp_redis::client::hstrlen ( const std::string &  key,
const std::string &  field 
)

◆ hvals() [1/2]

client& cpp_redis::client::hvals ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ hvals() [2/2]

std::future<reply> cpp_redis::client::hvals ( const std::string &  key)

◆ incr() [1/2]

client& cpp_redis::client::incr ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ incr() [2/2]

std::future<reply> cpp_redis::client::incr ( const std::string &  key)

◆ incrby() [1/2]

client& cpp_redis::client::incrby ( const std::string &  key,
int  incr,
const reply_callback_t reply_callback 
)

◆ incrby() [2/2]

std::future<reply> cpp_redis::client::incrby ( const std::string &  key,
int  incr 
)

◆ incrbyfloat() [1/2]

client& cpp_redis::client::incrbyfloat ( const std::string &  key,
float  incr,
const reply_callback_t reply_callback 
)

◆ incrbyfloat() [2/2]

std::future<reply> cpp_redis::client::incrbyfloat ( const std::string &  key,
float  incr 
)

◆ info() [1/3]

client& cpp_redis::client::info ( const reply_callback_t reply_callback)

◆ info() [2/3]

client& cpp_redis::client::info ( const std::string &  section,
const reply_callback_t reply_callback 
)

◆ info() [3/3]

std::future<reply> cpp_redis::client::info ( const std::string &  section = "default")

◆ is_connected()

bool cpp_redis::client::is_connected ( void  ) const
Returns
whether we are connected to the redis server

◆ is_reconnecting()

bool cpp_redis::client::is_reconnecting ( void  ) const
Returns
whether an attemp to reconnect is in progress

◆ keys() [1/2]

client& cpp_redis::client::keys ( const std::string &  pattern,
const reply_callback_t reply_callback 
)

◆ keys() [2/2]

std::future<reply> cpp_redis::client::keys ( const std::string &  pattern)

◆ lastsave() [1/2]

client& cpp_redis::client::lastsave ( const reply_callback_t reply_callback)

◆ lastsave() [2/2]

std::future<reply> cpp_redis::client::lastsave ( )

◆ lindex() [1/2]

client& cpp_redis::client::lindex ( const std::string &  key,
int  index,
const reply_callback_t reply_callback 
)

◆ lindex() [2/2]

std::future<reply> cpp_redis::client::lindex ( const std::string &  key,
int  index 
)

◆ linsert() [1/2]

client& cpp_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 
)

◆ linsert() [2/2]

std::future<reply> cpp_redis::client::linsert ( const std::string &  key,
const std::string &  before_after,
const std::string &  pivot,
const std::string &  value 
)

◆ llen() [1/2]

client& cpp_redis::client::llen ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ llen() [2/2]

std::future<reply> cpp_redis::client::llen ( const std::string &  key)

◆ lpop() [1/2]

client& cpp_redis::client::lpop ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ lpop() [2/2]

std::future<reply> cpp_redis::client::lpop ( const std::string &  key)

◆ lpush() [1/2]

client& cpp_redis::client::lpush ( const std::string &  key,
const std::vector< std::string > &  values,
const reply_callback_t reply_callback 
)

◆ lpush() [2/2]

std::future<reply> cpp_redis::client::lpush ( const std::string &  key,
const std::vector< std::string > &  values 
)

◆ lpushx() [1/2]

client& cpp_redis::client::lpushx ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ lpushx() [2/2]

std::future<reply> cpp_redis::client::lpushx ( const std::string &  key,
const std::string &  value 
)

◆ lrange() [1/2]

client& cpp_redis::client::lrange ( const std::string &  key,
int  start,
int  stop,
const reply_callback_t reply_callback 
)

◆ lrange() [2/2]

std::future<reply> cpp_redis::client::lrange ( const std::string &  key,
int  start,
int  stop 
)

◆ lrem() [1/2]

client& cpp_redis::client::lrem ( const std::string &  key,
int  count,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ lrem() [2/2]

std::future<reply> cpp_redis::client::lrem ( const std::string &  key,
int  count,
const std::string &  value 
)

◆ lset() [1/2]

client& cpp_redis::client::lset ( const std::string &  key,
int  index,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ lset() [2/2]

std::future<reply> cpp_redis::client::lset ( const std::string &  key,
int  index,
const std::string &  value 
)

◆ ltrim() [1/2]

client& cpp_redis::client::ltrim ( const std::string &  key,
int  start,
int  stop,
const reply_callback_t reply_callback 
)

◆ ltrim() [2/2]

std::future<reply> cpp_redis::client::ltrim ( const std::string &  key,
int  start,
int  stop 
)

◆ mget() [1/2]

client& cpp_redis::client::mget ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ mget() [2/2]

std::future<reply> cpp_redis::client::mget ( const std::vector< std::string > &  keys)

◆ migrate() [1/3]

client& cpp_redis::client::migrate ( const std::string &  host,
int  port,
const std::string &  key,
const std::string &  dest_db,
int  timeout,
const reply_callback_t reply_callback 
)

◆ migrate() [2/3]

client& cpp_redis::client::migrate ( const std::string &  host,
int  port,
const std::string &  key,
const std::string &  dest_db,
int  timeout,
bool  copy,
bool  replace,
const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ migrate() [3/3]

std::future<reply> cpp_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 = {} 
)

◆ monitor() [1/2]

client& cpp_redis::client::monitor ( const reply_callback_t reply_callback)

◆ monitor() [2/2]

std::future<reply> cpp_redis::client::monitor ( )

◆ move() [1/2]

client& cpp_redis::client::move ( const std::string &  key,
const std::string &  db,
const reply_callback_t reply_callback 
)

◆ move() [2/2]

std::future<reply> cpp_redis::client::move ( const std::string &  key,
const std::string &  db 
)

◆ mset() [1/2]

client& cpp_redis::client::mset ( const std::vector< std::pair< std::string, std::string >> &  key_vals,
const reply_callback_t reply_callback 
)

◆ mset() [2/2]

std::future<reply> cpp_redis::client::mset ( const std::vector< std::pair< std::string, std::string >> &  key_vals)

◆ msetnx() [1/2]

client& cpp_redis::client::msetnx ( const std::vector< std::pair< std::string, std::string >> &  key_vals,
const reply_callback_t reply_callback 
)

◆ msetnx() [2/2]

std::future<reply> cpp_redis::client::msetnx ( const std::vector< std::pair< std::string, std::string >> &  key_vals)

◆ multi() [1/2]

client& cpp_redis::client::multi ( const reply_callback_t reply_callback)

◆ multi() [2/2]

std::future<reply> cpp_redis::client::multi ( )

◆ object() [1/2]

client& cpp_redis::client::object ( const std::string &  subcommand,
const std::vector< std::string > &  args,
const reply_callback_t reply_callback 
)

◆ object() [2/2]

std::future<reply> cpp_redis::client::object ( const std::string &  subcommand,
const std::vector< std::string > &  args 
)

◆ operator=()

client& cpp_redis::client::operator= ( const client )
delete

assignment operator

◆ persist() [1/2]

client& cpp_redis::client::persist ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ persist() [2/2]

std::future<reply> cpp_redis::client::persist ( const std::string &  key)

◆ pexpire() [1/2]

client& cpp_redis::client::pexpire ( const std::string &  key,
int  milliseconds,
const reply_callback_t reply_callback 
)

◆ pexpire() [2/2]

std::future<reply> cpp_redis::client::pexpire ( const std::string &  key,
int  milliseconds 
)

◆ pexpireat() [1/2]

client& cpp_redis::client::pexpireat ( const std::string &  key,
int  milliseconds_timestamp,
const reply_callback_t reply_callback 
)

◆ pexpireat() [2/2]

std::future<reply> cpp_redis::client::pexpireat ( const std::string &  key,
int  milliseconds_timestamp 
)

◆ pfadd() [1/2]

client& cpp_redis::client::pfadd ( const std::string &  key,
const std::vector< std::string > &  elements,
const reply_callback_t reply_callback 
)

◆ pfadd() [2/2]

std::future<reply> cpp_redis::client::pfadd ( const std::string &  key,
const std::vector< std::string > &  elements 
)

◆ pfcount() [1/2]

client& cpp_redis::client::pfcount ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ pfcount() [2/2]

std::future<reply> cpp_redis::client::pfcount ( const std::vector< std::string > &  keys)

◆ pfmerge() [1/2]

client& cpp_redis::client::pfmerge ( const std::string &  destkey,
const std::vector< std::string > &  sourcekeys,
const reply_callback_t reply_callback 
)

◆ pfmerge() [2/2]

std::future<reply> cpp_redis::client::pfmerge ( const std::string &  destkey,
const std::vector< std::string > &  sourcekeys 
)

◆ ping() [1/4]

client& cpp_redis::client::ping ( const reply_callback_t reply_callback)

◆ ping() [2/4]

std::future<reply> cpp_redis::client::ping ( )

◆ ping() [3/4]

client& cpp_redis::client::ping ( const std::string &  message,
const reply_callback_t reply_callback 
)

◆ ping() [4/4]

std::future<reply> cpp_redis::client::ping ( const std::string &  message)

◆ psetex() [1/2]

client& cpp_redis::client::psetex ( const std::string &  key,
int  milliseconds,
const std::string &  val,
const reply_callback_t reply_callback 
)

◆ psetex() [2/2]

std::future<reply> cpp_redis::client::psetex ( const std::string &  key,
int  milliseconds,
const std::string &  val 
)

◆ pttl() [1/2]

client& cpp_redis::client::pttl ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ pttl() [2/2]

std::future<reply> cpp_redis::client::pttl ( const std::string &  key)

◆ publish() [1/2]

client& cpp_redis::client::publish ( const std::string &  channel,
const std::string &  message,
const reply_callback_t reply_callback 
)

◆ publish() [2/2]

std::future<reply> cpp_redis::client::publish ( const std::string &  channel,
const std::string &  message 
)

◆ pubsub() [1/2]

client& cpp_redis::client::pubsub ( const std::string &  subcommand,
const std::vector< std::string > &  args,
const reply_callback_t reply_callback 
)

◆ pubsub() [2/2]

std::future<reply> cpp_redis::client::pubsub ( const std::string &  subcommand,
const std::vector< std::string > &  args 
)

◆ quit() [1/2]

client& cpp_redis::client::quit ( const reply_callback_t reply_callback)

◆ quit() [2/2]

std::future<reply> cpp_redis::client::quit ( )

◆ randomkey() [1/2]

client& cpp_redis::client::randomkey ( const reply_callback_t reply_callback)

◆ randomkey() [2/2]

std::future<reply> cpp_redis::client::randomkey ( )

◆ re_auth()

void cpp_redis::client::re_auth ( void  )
private

re authenticate to redis server based on previously used password

◆ re_select()

void cpp_redis::client::re_select ( void  )
private

re select db to redis server based on previously selected db

◆ readonly() [1/2]

client& cpp_redis::client::readonly ( const reply_callback_t reply_callback)

◆ readonly() [2/2]

std::future<reply> cpp_redis::client::readonly ( )

◆ readwrite() [1/2]

client& cpp_redis::client::readwrite ( const reply_callback_t reply_callback)

◆ readwrite() [2/2]

std::future<reply> cpp_redis::client::readwrite ( )

◆ reconnect()

void cpp_redis::client::reconnect ( void  )
private

reconnect to the previously connected host automatically re authenticate and resubscribe to subscribed channel in case of success

◆ rename() [1/2]

client& cpp_redis::client::rename ( const std::string &  key,
const std::string &  newkey,
const reply_callback_t reply_callback 
)

◆ rename() [2/2]

std::future<reply> cpp_redis::client::rename ( const std::string &  key,
const std::string &  newkey 
)

◆ renamenx() [1/2]

client& cpp_redis::client::renamenx ( const std::string &  key,
const std::string &  newkey,
const reply_callback_t reply_callback 
)

◆ renamenx() [2/2]

std::future<reply> cpp_redis::client::renamenx ( const std::string &  key,
const std::string &  newkey 
)

◆ resend_failed_commands()

void cpp_redis::client::resend_failed_commands ( void  )
private

resend all pending commands that failed to be sent due to disconnection

◆ restore() [1/4]

client& cpp_redis::client::restore ( const std::string &  key,
int  ttl,
const std::string &  serialized_value,
const reply_callback_t reply_callback 
)

◆ restore() [2/4]

std::future<reply> cpp_redis::client::restore ( const std::string &  key,
int  ttl,
const std::string &  serialized_value 
)

◆ restore() [3/4]

client& cpp_redis::client::restore ( const std::string &  key,
int  ttl,
const std::string &  serialized_value,
const std::string &  replace,
const reply_callback_t reply_callback 
)

◆ restore() [4/4]

std::future<reply> cpp_redis::client::restore ( const std::string &  key,
int  ttl,
const std::string &  serialized_value,
const std::string &  replace 
)

◆ role() [1/2]

client& cpp_redis::client::role ( const reply_callback_t reply_callback)

◆ role() [2/2]

std::future<reply> cpp_redis::client::role ( )

◆ rpop() [1/2]

client& cpp_redis::client::rpop ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ rpop() [2/2]

std::future<reply> cpp_redis::client::rpop ( const std::string &  key)

◆ rpoplpush() [1/2]

client& cpp_redis::client::rpoplpush ( const std::string &  source,
const std::string &  destination,
const reply_callback_t reply_callback 
)

◆ rpoplpush() [2/2]

std::future<reply> cpp_redis::client::rpoplpush ( const std::string &  src,
const std::string &  dst 
)

◆ rpush() [1/2]

client& cpp_redis::client::rpush ( const std::string &  key,
const std::vector< std::string > &  values,
const reply_callback_t reply_callback 
)

◆ rpush() [2/2]

std::future<reply> cpp_redis::client::rpush ( const std::string &  key,
const std::vector< std::string > &  values 
)

◆ rpushx() [1/2]

client& cpp_redis::client::rpushx ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ rpushx() [2/2]

std::future<reply> cpp_redis::client::rpushx ( const std::string &  key,
const std::string &  value 
)

◆ sadd() [1/2]

client& cpp_redis::client::sadd ( const std::string &  key,
const std::vector< std::string > &  members,
const reply_callback_t reply_callback 
)

◆ sadd() [2/2]

std::future<reply> cpp_redis::client::sadd ( const std::string &  key,
const std::vector< std::string > &  members 
)

◆ save() [1/2]

client& cpp_redis::client::save ( const reply_callback_t reply_callback)

◆ save() [2/2]

std::future<reply> cpp_redis::client::save ( )

◆ scan() [1/2]

client& cpp_redis::client::scan ( int  cursor,
const std::string &  pattern,
int  count,
const reply_callback_t reply_callback 
)

◆ scan() [2/2]

std::future<reply> cpp_redis::client::scan ( int  cursor,
const std::string &  pattern,
int  count 
)

◆ scard() [1/2]

client& cpp_redis::client::scard ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ scard() [2/2]

std::future<reply> cpp_redis::client::scard ( const std::string &  key)

◆ script_debug() [1/2]

client& cpp_redis::client::script_debug ( const std::string &  mode,
const reply_callback_t reply_callback 
)

◆ script_debug() [2/2]

std::future<reply> cpp_redis::client::script_debug ( const std::string &  mode)

◆ script_exists() [1/2]

client& cpp_redis::client::script_exists ( const std::vector< std::string > &  scripts,
const reply_callback_t reply_callback 
)

◆ script_exists() [2/2]

std::future<reply> cpp_redis::client::script_exists ( const std::vector< std::string > &  scripts)

◆ script_flush() [1/2]

client& cpp_redis::client::script_flush ( const reply_callback_t reply_callback)

◆ script_flush() [2/2]

std::future<reply> cpp_redis::client::script_flush ( )

◆ script_kill() [1/2]

client& cpp_redis::client::script_kill ( const reply_callback_t reply_callback)

◆ script_kill() [2/2]

std::future<reply> cpp_redis::client::script_kill ( )

◆ script_load() [1/2]

client& cpp_redis::client::script_load ( const std::string &  script,
const reply_callback_t reply_callback 
)

◆ script_load() [2/2]

std::future<reply> cpp_redis::client::script_load ( const std::string &  script)

◆ sdiff() [1/2]

client& cpp_redis::client::sdiff ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sdiff() [2/2]

std::future<reply> cpp_redis::client::sdiff ( const std::vector< std::string > &  keys)

◆ sdiffstore() [1/2]

client& cpp_redis::client::sdiffstore ( const std::string &  destination,
const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sdiffstore() [2/2]

std::future<reply> cpp_redis::client::sdiffstore ( const std::string &  dst,
const std::vector< std::string > &  keys 
)

◆ select() [1/2]

client& cpp_redis::client::select ( int  index,
const reply_callback_t reply_callback 
)

◆ select() [2/2]

std::future<reply> cpp_redis::client::select ( int  index)

◆ send() [1/2]

client& cpp_redis::client::send ( const std::vector< std::string > &  redis_cmd,
const reply_callback_t callback 
)

send the given command the command is actually pipelined and only buffered, so nothing is sent to the network please call commit() / sync_commit() to flush the buffer

Parameters
redis_cmdcommand to be sent
callbackcallback to be called on received reply
Returns
current instance

◆ send() [2/2]

std::future<reply> cpp_redis::client::send ( const std::vector< std::string > &  redis_cmd)

same as the other send method but future based: does not take any callback and return an std:;future to handle the reply

Parameters
redis_cmdcommand to be sent
Returns
std::future to handler redis reply

◆ set() [1/2]

client& cpp_redis::client::set ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ set() [2/2]

std::future<reply> cpp_redis::client::set ( const std::string &  key,
const std::string &  value 
)

◆ set_advanced() [1/3]

client& cpp_redis::client::set_advanced ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ set_advanced() [2/3]

client& cpp_redis::client::set_advanced ( const std::string &  key,
const std::string &  value,
bool  ex,
int  ex_sec,
bool  px,
int  px_milli,
bool  nx,
bool  xx,
const reply_callback_t reply_callback 
)

◆ set_advanced() [3/3]

std::future<reply> cpp_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 
)

◆ setbit_() [1/2]

client& cpp_redis::client::setbit_ ( const std::string &  key,
int  offset,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ setbit_() [2/2]

std::future<reply> cpp_redis::client::setbit_ ( const std::string &  key,
int  offset,
const std::string &  value 
)

◆ setex() [1/2]

client& cpp_redis::client::setex ( const std::string &  key,
int  seconds,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ setex() [2/2]

std::future<reply> cpp_redis::client::setex ( const std::string &  key,
int  seconds,
const std::string &  value 
)

◆ setnx() [1/2]

client& cpp_redis::client::setnx ( const std::string &  key,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ setnx() [2/2]

std::future<reply> cpp_redis::client::setnx ( const std::string &  key,
const std::string &  value 
)

◆ setrange() [1/2]

client& cpp_redis::client::setrange ( const std::string &  key,
int  offset,
const std::string &  value,
const reply_callback_t reply_callback 
)

◆ setrange() [2/2]

std::future<reply> cpp_redis::client::setrange ( const std::string &  key,
int  offset,
const std::string &  value 
)

◆ should_reconnect()

bool cpp_redis::client::should_reconnect ( void  ) const
private
Returns
whether a reconnection attempt should be performed

◆ shutdown() [1/4]

client& cpp_redis::client::shutdown ( const reply_callback_t reply_callback)

◆ shutdown() [2/4]

std::future<reply> cpp_redis::client::shutdown ( )

◆ shutdown() [3/4]

client& cpp_redis::client::shutdown ( const std::string &  save,
const reply_callback_t reply_callback 
)

◆ shutdown() [4/4]

std::future<reply> cpp_redis::client::shutdown ( const std::string &  save)

◆ sinter() [1/2]

client& cpp_redis::client::sinter ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sinter() [2/2]

std::future<reply> cpp_redis::client::sinter ( const std::vector< std::string > &  keys)

◆ sinterstore() [1/2]

client& cpp_redis::client::sinterstore ( const std::string &  destination,
const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sinterstore() [2/2]

std::future<reply> cpp_redis::client::sinterstore ( const std::string &  dst,
const std::vector< std::string > &  keys 
)

◆ sismember() [1/2]

client& cpp_redis::client::sismember ( const std::string &  key,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ sismember() [2/2]

std::future<reply> cpp_redis::client::sismember ( const std::string &  key,
const std::string &  member 
)

◆ slaveof() [1/2]

client& cpp_redis::client::slaveof ( const std::string &  host,
int  port,
const reply_callback_t reply_callback 
)

◆ slaveof() [2/2]

std::future<reply> cpp_redis::client::slaveof ( const std::string &  host,
int  port 
)

◆ sleep_before_next_reconnect_attempt()

void cpp_redis::client::sleep_before_next_reconnect_attempt ( void  )
private

sleep between two reconnect attemps if necessary

◆ slowlog() [1/4]

client& cpp_redis::client::slowlog ( const std::string  subcommand,
const reply_callback_t reply_callback 
)

◆ slowlog() [2/4]

std::future<reply> cpp_redis::client::slowlog ( const std::string &  subcommand)

◆ slowlog() [3/4]

client& cpp_redis::client::slowlog ( const std::string  subcommand,
const std::string &  argument,
const reply_callback_t reply_callback 
)

◆ slowlog() [4/4]

std::future<reply> cpp_redis::client::slowlog ( const std::string &  subcommand,
const std::string &  argument 
)

◆ smembers() [1/2]

client& cpp_redis::client::smembers ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ smembers() [2/2]

std::future<reply> cpp_redis::client::smembers ( const std::string &  key)

◆ smove() [1/2]

client& cpp_redis::client::smove ( const std::string &  source,
const std::string &  destination,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ smove() [2/2]

std::future<reply> cpp_redis::client::smove ( const std::string &  src,
const std::string &  dst,
const std::string &  member 
)

◆ spop() [1/4]

client& cpp_redis::client::spop ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ spop() [2/4]

std::future<reply> cpp_redis::client::spop ( const std::string &  key)

◆ spop() [3/4]

client& cpp_redis::client::spop ( const std::string &  key,
int  count,
const reply_callback_t reply_callback 
)

◆ spop() [4/4]

std::future<reply> cpp_redis::client::spop ( const std::string &  key,
int  count 
)

◆ srandmember() [1/4]

client& cpp_redis::client::srandmember ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ srandmember() [2/4]

std::future<reply> cpp_redis::client::srandmember ( const std::string &  key)

◆ srandmember() [3/4]

client& cpp_redis::client::srandmember ( const std::string &  key,
int  count,
const reply_callback_t reply_callback 
)

◆ srandmember() [4/4]

std::future<reply> cpp_redis::client::srandmember ( const std::string &  key,
int  count 
)

◆ srem() [1/2]

client& cpp_redis::client::srem ( const std::string &  key,
const std::vector< std::string > &  members,
const reply_callback_t reply_callback 
)

◆ srem() [2/2]

std::future<reply> cpp_redis::client::srem ( const std::string &  key,
const std::vector< std::string > &  members 
)

◆ strlen() [1/2]

client& cpp_redis::client::strlen ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ strlen() [2/2]

std::future<reply> cpp_redis::client::strlen ( const std::string &  key)

◆ sunion() [1/2]

client& cpp_redis::client::sunion ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sunion() [2/2]

std::future<reply> cpp_redis::client::sunion ( const std::vector< std::string > &  keys)

◆ sunionstore() [1/2]

client& cpp_redis::client::sunionstore ( const std::string &  destination,
const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ sunionstore() [2/2]

std::future<reply> cpp_redis::client::sunionstore ( const std::string &  dst,
const std::vector< std::string > &  keys 
)

◆ sync() [1/2]

client& cpp_redis::client::sync ( const reply_callback_t reply_callback)

◆ sync() [2/2]

std::future<reply> cpp_redis::client::sync ( )

◆ sync_commit() [1/2]

client& cpp_redis::client::sync_commit ( void  )

same as commit(), but synchronous will block until all pending commands have been sent and that a reply has been received for each of them and all underlying callbacks completed

Returns
current instance

◆ sync_commit() [2/2]

template<class Rep , class Period >
client& cpp_redis::client::sync_commit ( const std::chrono::duration< Rep, Period > &  timeout)
inline

same as sync_commit, but with a timeout will simply block until it completes or timeout expires

Returns
current instance

no need to call commit in case of reconnection the reconnection flow will do it for us

◆ time() [1/2]

client& cpp_redis::client::time ( const reply_callback_t reply_callback)

◆ time() [2/2]

std::future<reply> cpp_redis::client::time ( )

◆ try_commit()

void cpp_redis::client::try_commit ( void  )
private

try to commit the pending pipelined if client is disconnected, will throw an exception and clear all pending callbacks (call clear_callbacks())

◆ ttl() [1/2]

client& cpp_redis::client::ttl ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ ttl() [2/2]

std::future<reply> cpp_redis::client::ttl ( const std::string &  key)

◆ type() [1/2]

client& cpp_redis::client::type ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ type() [2/2]

std::future<reply> cpp_redis::client::type ( const std::string &  key)

◆ unprotected_auth()

void cpp_redis::client::unprotected_auth ( const std::string &  password,
const reply_callback_t reply_callback 
)
private

unprotected auth same as auth, but without any mutex lock

Parameters
passwordpassword to be used for authentication
reply_callbackcallback to be called whenever a reply is received

◆ unprotected_select()

void cpp_redis::client::unprotected_select ( int  index,
const reply_callback_t reply_callback 
)
private

unprotected select same as select, but without any mutex lock

Parameters
indexindex to be used for db select
reply_callbackcallback to be called whenever a reply is received

◆ unprotected_send()

void cpp_redis::client::unprotected_send ( const std::vector< std::string > &  redis_cmd,
const reply_callback_t callback 
)
private

unprotected send same as send, but without any mutex lock

Parameters
redis_cmdcmd to be sent
callbackcallback to be called whenever a reply is received

◆ unwatch() [1/2]

client& cpp_redis::client::unwatch ( const reply_callback_t reply_callback)

◆ unwatch() [2/2]

std::future<reply> cpp_redis::client::unwatch ( )

◆ wait() [1/2]

client& cpp_redis::client::wait ( int  numslaves,
int  timeout,
const reply_callback_t reply_callback 
)

◆ wait() [2/2]

std::future<reply> cpp_redis::client::wait ( int  numslaves,
int  timeout 
)

◆ watch() [1/2]

client& cpp_redis::client::watch ( const std::vector< std::string > &  keys,
const reply_callback_t reply_callback 
)

◆ watch() [2/2]

std::future<reply> cpp_redis::client::watch ( const std::vector< std::string > &  keys)

◆ zadd() [1/2]

client& cpp_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 
)

◆ zadd() [2/2]

std::future<reply> cpp_redis::client::zadd ( const std::string &  key,
const std::vector< std::string > &  options,
const std::map< std::string, std::string > &  score_members 
)

◆ zcard() [1/2]

client& cpp_redis::client::zcard ( const std::string &  key,
const reply_callback_t reply_callback 
)

◆ zcard() [2/2]

std::future<reply> cpp_redis::client::zcard ( const std::string &  key)

◆ zcount() [1/6]

client& cpp_redis::client::zcount ( const std::string &  key,
int  min,
int  max,
const reply_callback_t reply_callback 
)

◆ zcount() [2/6]

std::future<reply> cpp_redis::client::zcount ( const std::string &  key,
int  min,
int  max 
)

◆ zcount() [3/6]

client& cpp_redis::client::zcount ( const std::string &  key,
double  min,
double  max,
const reply_callback_t reply_callback 
)

◆ zcount() [4/6]

std::future<reply> cpp_redis::client::zcount ( const std::string &  key,
double  min,
double  max 
)

◆ zcount() [5/6]

client& cpp_redis::client::zcount ( const std::string &  key,
const std::string &  min,
const std::string &  max,
const reply_callback_t reply_callback 
)

◆ zcount() [6/6]

std::future<reply> cpp_redis::client::zcount ( const std::string &  key,
const std::string &  min,
const std::string &  max 
)

◆ zincrby() [1/6]

client& cpp_redis::client::zincrby ( const std::string &  key,
int  incr,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zincrby() [2/6]

std::future<reply> cpp_redis::client::zincrby ( const std::string &  key,
int  incr,
const std::string &  member 
)

◆ zincrby() [3/6]

client& cpp_redis::client::zincrby ( const std::string &  key,
double  incr,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zincrby() [4/6]

std::future<reply> cpp_redis::client::zincrby ( const std::string &  key,
double  incr,
const std::string &  member 
)

◆ zincrby() [5/6]

client& cpp_redis::client::zincrby ( const std::string &  key,
const std::string &  incr,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zincrby() [6/6]

std::future<reply> cpp_redis::client::zincrby ( const std::string &  key,
const std::string &  incr,
const std::string &  member 
)

◆ zlexcount() [1/6]

client& cpp_redis::client::zlexcount ( const std::string &  key,
int  min,
int  max,
const reply_callback_t reply_callback 
)

◆ zlexcount() [2/6]

std::future<reply> cpp_redis::client::zlexcount ( const std::string &  key,
int  min,
int  max 
)

◆ zlexcount() [3/6]

client& cpp_redis::client::zlexcount ( const std::string &  key,
double  min,
double  max,
const reply_callback_t reply_callback 
)

◆ zlexcount() [4/6]

std::future<reply> cpp_redis::client::zlexcount ( const std::string &  key,
double  min,
double  max 
)

◆ zlexcount() [5/6]

client& cpp_redis::client::zlexcount ( const std::string &  key,
const std::string &  min,
const std::string &  max,
const reply_callback_t reply_callback 
)

◆ zlexcount() [6/6]

std::future<reply> cpp_redis::client::zlexcount ( const std::string &  key,
const std::string &  min,
const std::string &  max 
)

◆ zrange() [1/9]

client& cpp_redis::client::zrange ( const std::string &  key,
int  start,
int  stop,
const reply_callback_t reply_callback 
)

◆ zrange() [2/9]

client& cpp_redis::client::zrange ( const std::string &  key,
int  start,
int  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrange() [3/9]

std::future<reply> cpp_redis::client::zrange ( const std::string &  key,
int  start,
int  stop,
bool  withscores = false 
)

◆ zrange() [4/9]

client& cpp_redis::client::zrange ( const std::string &  key,
double  start,
double  stop,
const reply_callback_t reply_callback 
)

◆ zrange() [5/9]

client& cpp_redis::client::zrange ( const std::string &  key,
double  start,
double  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrange() [6/9]

std::future<reply> cpp_redis::client::zrange ( const std::string &  key,
double  start,
double  stop,
bool  withscores = false 
)

◆ zrange() [7/9]

client& cpp_redis::client::zrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
const reply_callback_t reply_callback 
)

◆ zrange() [8/9]

client& cpp_redis::client::zrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrange() [9/9]

std::future<reply> cpp_redis::client::zrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
bool  withscores = false 
)

◆ zrank() [1/2]

client& cpp_redis::client::zrank ( const std::string &  key,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zrank() [2/2]

std::future<reply> cpp_redis::client::zrank ( const std::string &  key,
const std::string &  member 
)

◆ zrem() [1/2]

client& cpp_redis::client::zrem ( const std::string &  key,
const std::vector< std::string > &  members,
const reply_callback_t reply_callback 
)

◆ zrem() [2/2]

std::future<reply> cpp_redis::client::zrem ( const std::string &  key,
const std::vector< std::string > &  members 
)

◆ zremrangebylex() [1/6]

client& cpp_redis::client::zremrangebylex ( const std::string &  key,
int  min,
int  max,
const reply_callback_t reply_callback 
)

◆ zremrangebylex() [2/6]

std::future<reply> cpp_redis::client::zremrangebylex ( const std::string &  key,
int  min,
int  max 
)

◆ zremrangebylex() [3/6]

client& cpp_redis::client::zremrangebylex ( const std::string &  key,
double  min,
double  max,
const reply_callback_t reply_callback 
)

◆ zremrangebylex() [4/6]

std::future<reply> cpp_redis::client::zremrangebylex ( const std::string &  key,
double  min,
double  max 
)

◆ zremrangebylex() [5/6]

client& cpp_redis::client::zremrangebylex ( const std::string &  key,
const std::string &  min,
const std::string &  max,
const reply_callback_t reply_callback 
)

◆ zremrangebylex() [6/6]

std::future<reply> cpp_redis::client::zremrangebylex ( const std::string &  key,
const std::string &  min,
const std::string &  max 
)

◆ zremrangebyrank() [1/6]

client& cpp_redis::client::zremrangebyrank ( const std::string &  key,
int  start,
int  stop,
const reply_callback_t reply_callback 
)

◆ zremrangebyrank() [2/6]

std::future<reply> cpp_redis::client::zremrangebyrank ( const std::string &  key,
int  start,
int  stop 
)

◆ zremrangebyrank() [3/6]

client& cpp_redis::client::zremrangebyrank ( const std::string &  key,
double  start,
double  stop,
const reply_callback_t reply_callback 
)

◆ zremrangebyrank() [4/6]

std::future<reply> cpp_redis::client::zremrangebyrank ( const std::string &  key,
double  start,
double  stop 
)

◆ zremrangebyrank() [5/6]

client& cpp_redis::client::zremrangebyrank ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
const reply_callback_t reply_callback 
)

◆ zremrangebyrank() [6/6]

std::future<reply> cpp_redis::client::zremrangebyrank ( const std::string &  key,
const std::string &  start,
const std::string &  stop 
)

◆ zremrangebyscore() [1/6]

client& cpp_redis::client::zremrangebyscore ( const std::string &  key,
int  min,
int  max,
const reply_callback_t reply_callback 
)

◆ zremrangebyscore() [2/6]

std::future<reply> cpp_redis::client::zremrangebyscore ( const std::string &  key,
int  min,
int  max 
)

◆ zremrangebyscore() [3/6]

client& cpp_redis::client::zremrangebyscore ( const std::string &  key,
double  min,
double  max,
const reply_callback_t reply_callback 
)

◆ zremrangebyscore() [4/6]

std::future<reply> cpp_redis::client::zremrangebyscore ( const std::string &  key,
double  min,
double  max 
)

◆ zremrangebyscore() [5/6]

client& cpp_redis::client::zremrangebyscore ( const std::string &  key,
const std::string &  min,
const std::string &  max,
const reply_callback_t reply_callback 
)

◆ zremrangebyscore() [6/6]

std::future<reply> cpp_redis::client::zremrangebyscore ( const std::string &  key,
const std::string &  min,
const std::string &  max 
)

◆ zrevrange() [1/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
int  start,
int  stop,
const reply_callback_t reply_callback 
)

◆ zrevrange() [2/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
int  start,
int  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrevrange() [3/9]

std::future<reply> cpp_redis::client::zrevrange ( const std::string &  key,
int  start,
int  stop,
bool  withscores = false 
)

◆ zrevrange() [4/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
double  start,
double  stop,
const reply_callback_t reply_callback 
)

◆ zrevrange() [5/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
double  start,
double  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrevrange() [6/9]

std::future<reply> cpp_redis::client::zrevrange ( const std::string &  key,
double  start,
double  stop,
bool  withscores = false 
)

◆ zrevrange() [7/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
const reply_callback_t reply_callback 
)

◆ zrevrange() [8/9]

client& cpp_redis::client::zrevrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
bool  withscores,
const reply_callback_t reply_callback 
)

◆ zrevrange() [9/9]

std::future<reply> cpp_redis::client::zrevrange ( const std::string &  key,
const std::string &  start,
const std::string &  stop,
bool  withscores = false 
)

◆ zrevrank() [1/2]

client& cpp_redis::client::zrevrank ( const std::string &  key,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zrevrank() [2/2]

std::future<reply> cpp_redis::client::zrevrank ( const std::string &  key,
const std::string &  member 
)

◆ zscore() [1/2]

client& cpp_redis::client::zscore ( const std::string &  key,
const std::string &  member,
const reply_callback_t reply_callback 
)

◆ zscore() [2/2]

std::future<reply> cpp_redis::client::zscore ( const std::string &  key,
const std::string &  member 
)

Member Data Documentation

◆ m_callbacks_mutex

std::mutex cpp_redis::client::m_callbacks_mutex
private

callbacks thread safety

◆ m_callbacks_running

std::atomic<unsigned int> cpp_redis::client::m_callbacks_running = ATOMIC_VAR_INIT(0)
private

number of callbacks currently being running

◆ m_cancel

std::atomic_bool cpp_redis::client::m_cancel = ATOMIC_VAR_INIT(false)
private

to force cancel reconnection

◆ m_client

network::redis_connection cpp_redis::client::m_client
private

tcp client for redis connection

◆ m_commands

std::queue<command_request> cpp_redis::client::m_commands
private

sent commands waiting to be executed

◆ m_connect_callback

connect_callback_t cpp_redis::client::m_connect_callback
private

user defined connect status callback

◆ m_connect_timeout_msecs

std::uint32_t cpp_redis::client::m_connect_timeout_msecs = 0
private

max time to connect

◆ m_current_reconnect_attempts

std::int32_t cpp_redis::client::m_current_reconnect_attempts = 0
private

current number of attemps to reconect

◆ m_database_index

int cpp_redis::client::m_database_index = 0
private

selected redis db

◆ m_master_name

std::string cpp_redis::client::m_master_name
private

master name (if we are using sentinel) we are connected to

◆ m_max_reconnects

std::int32_t cpp_redis::client::m_max_reconnects = 0
private

max number of reconnection attemps

◆ m_password

std::string cpp_redis::client::m_password
private

password used to authenticate

◆ m_reconnect_interval_msecs

std::uint32_t cpp_redis::client::m_reconnect_interval_msecs = 0
private

time between two reconnection attemps

◆ m_reconnecting

std::atomic_bool cpp_redis::client::m_reconnecting = ATOMIC_VAR_INIT(false)
private

reconnection status

◆ m_redis_port

std::size_t cpp_redis::client::m_redis_port = 0
private

port we are connected to

◆ m_redis_server

std::string cpp_redis::client::m_redis_server
private

server we are connected to

◆ m_sentinel

cpp_redis::sentinel cpp_redis::client::m_sentinel
private

redis sentinel

◆ m_sync_condvar

std::condition_variable cpp_redis::client::m_sync_condvar
private

condvar for callbacks updates


The documentation for this class was generated from the following files: