26 #include <condition_variable> 35 #include <cpp_redis/core/sentinel.hpp> 36 #include <cpp_redis/helpers/variadic_template.hpp> 37 #include <cpp_redis/misc/logger.hpp> 38 #include <cpp_redis/network/redis_connection.hpp> 39 #include <cpp_redis/network/tcp_client_iface.hpp> 82 #ifndef __CPP_REDIS_USE_CUSTOM_TCP_CLIENT 94 explicit client(
const std::shared_ptr<network::tcp_client_iface> &tcp_client);
109 typedef std::function<void(const std::string &host, std::size_t port, connect_state status)>
connect_callback_t;
122 const std::string &host =
"127.0.0.1",
123 std::size_t port = 6379,
125 std::uint32_t timeout_ms = 0,
126 std::int32_t max_reconnects = 0,
127 std::uint32_t reconnect_interval_ms = 0);
139 const std::string &m_name,
141 std::uint32_t timeout_ms = 0,
142 std::int32_t max_reconnects = 0,
143 std::uint32_t reconnect_interval_ms = 0);
155 void disconnect(
bool wait_for_removal =
false);
192 std::future<reply>
send(
const std::vector<std::string> &redis_cmd);
218 template<
class Rep,
class Period>
227 std::unique_lock<std::mutex> lock_callback(m_callbacks_mutex);
228 __CPP_REDIS_LOG(debug,
"cpp_redis::client waiting for callbacks to complete");
229 if (!m_sync_condvar.wait_for(lock_callback, timeout,
230 [=] { return m_callbacks_running == 0 && m_commands.empty(); })) {
231 __CPP_REDIS_LOG(debug,
"cpp_redis::client finished waiting for callback");
233 __CPP_REDIS_LOG(debug,
"cpp_redis::client timed out waiting for callback");
243 bool should_reconnect()
const;
248 void resend_failed_commands();
253 void sleep_before_next_reconnect_attempt();
279 void unprotected_send(
const std::vector<std::string> &redis_cmd,
const reply_callback_t &callback);
288 void unprotected_auth(
const std::string &password,
const reply_callback_t &reply_callback);
307 void add_sentinel(
const std::string &host, std::size_t port, std::uint32_t timeout_ms = 0);
479 append(
const std::string &key,
const std::string &value,
const reply_callback_t &reply_callback);
481 std::future<reply> append(
const std::string &key,
const std::string &value);
485 std::future<reply> auth(
const std::string &password);
489 std::future<reply> bgrewriteaof();
493 std::future<reply> bgsave();
497 std::future<reply> bitcount(
const std::string &key);
501 std::future<reply> bitcount(
const std::string &key,
int start,
int end);
503 client &bitfield(
const std::string &key,
const std::vector<bitfield_operation> &operations,
506 std::future<reply> bitfield(
const std::string &key,
const std::vector<bitfield_operation> &operations);
508 client &bitop(
const std::string &operation,
const std::string &destkey,
const std::vector<std::string> &keys,
512 bitop(
const std::string &operation,
const std::string &destkey,
const std::vector<std::string> &keys);
516 std::future<reply> bitpos(
const std::string &key,
int bit);
520 std::future<reply> bitpos(
const std::string &key,
int bit,
int start);
522 client &bitpos(
const std::string &key,
int bit,
int start,
int end,
const reply_callback_t &reply_callback);
524 std::future<reply> bitpos(
const std::string &key,
int bit,
int start,
int end);
528 std::future<reply> blpop(
const std::vector<std::string> &keys,
int timeout);
532 std::future<reply> brpop(
const std::vector<std::string> &keys,
int timeout);
535 brpoplpush(
const std::string &src,
const std::string &dst,
int timeout,
const reply_callback_t &reply_callback);
537 std::future<reply> brpoplpush(
const std::string &src,
const std::string &dst,
int timeout);
539 template<
typename T,
typename... Ts>
540 client &
client_kill(
const std::string &host,
int port,
const T &arg,
const Ts &... args);
544 template<
typename... Ts>
547 template<
typename T,
typename... Ts>
550 template<
typename T,
typename... Ts>
555 std::future<reply> client_list();
559 std::future<reply> client_getname();
563 std::future<reply> client_pause(
int timeout);
567 std::future<reply> client_reply(
const std::string &mode);
571 std::future<reply> client_setname(
const std::string &m_name);
573 client &cluster_addslots(
const std::vector<std::string> &p_slots,
const reply_callback_t &reply_callback);
575 std::future<reply> cluster_addslots(
const std::vector<std::string> &p_slots);
577 client &cluster_count_failure_reports(
const std::string &node_id,
const reply_callback_t &reply_callback);
579 std::future<reply> cluster_count_failure_reports(
const std::string &node_id);
583 std::future<reply> cluster_countkeysinslot(
const std::string &slot);
585 client &cluster_delslots(
const std::vector<std::string> &p_slots,
const reply_callback_t &reply_callback);
587 std::future<reply> cluster_delslots(
const std::vector<std::string> &p_slots);
591 std::future<reply> cluster_failover();
595 std::future<reply> cluster_failover(
const std::string &mode);
599 std::future<reply> cluster_forget(
const std::string &node_id);
601 client &cluster_getkeysinslot(
const std::string &slot,
int count,
const reply_callback_t &reply_callback);
603 std::future<reply> cluster_getkeysinslot(
const std::string &slot,
int count);
607 std::future<reply> cluster_info();
611 std::future<reply> cluster_keyslot(
const std::string &key);
615 std::future<reply> cluster_meet(
const std::string &ip,
int port);
619 std::future<reply> cluster_nodes();
623 std::future<reply> cluster_replicate(
const std::string &node_id);
629 std::future<reply> cluster_reset(
const std::string &mode =
"soft");
633 std::future<reply> cluster_saveconfig();
637 std::future<reply> cluster_set_config_epoch(
const std::string &epoch);
639 client &cluster_setslot(
const std::string &slot,
const std::string &mode,
const reply_callback_t &reply_callback);
641 std::future<reply> cluster_setslot(
const std::string &slot,
const std::string &mode);
643 client &cluster_setslot(
const std::string &slot,
const std::string &mode,
const std::string &node_id,
646 std::future<reply> cluster_setslot(
const std::string &slot,
const std::string &mode,
const std::string &node_id);
650 std::future<reply> cluster_slaves(
const std::string &node_id);
654 std::future<reply> cluster_slots();
658 std::future<reply> command();
662 std::future<reply> command_count();
666 std::future<reply> command_getkeys();
668 client &command_info(
const std::vector<std::string> &command_name,
const reply_callback_t &reply_callback);
670 std::future<reply> command_info(
const std::vector<std::string> &command_name);
674 std::future<reply> config_get(
const std::string ¶m);
678 std::future<reply> config_rewrite();
680 client &config_set(
const std::string ¶m,
const std::string &val,
const reply_callback_t &reply_callback);
682 std::future<reply> config_set(
const std::string ¶m,
const std::string &val);
686 std::future<reply> config_resetstat();
690 std::future<reply> dbsize();
694 std::future<reply> debug_object(
const std::string &key);
698 std::future<reply> debug_segfault();
702 std::future<reply> decr(
const std::string &key);
706 std::future<reply> decrby(
const std::string &key,
int val);
710 std::future<reply> del(
const std::vector<std::string> &key);
714 std::future<reply> discard();
718 std::future<reply> dump(
const std::string &key);
722 std::future<reply> echo(
const std::string &msg);
724 client &eval(
const std::string &script,
int numkeys,
const std::vector<std::string> &keys,
725 const std::vector<std::string> &args,
const reply_callback_t &reply_callback);
727 std::future<reply> eval(
const std::string &script,
int numkeys,
const std::vector<std::string> &keys,
728 const std::vector<std::string> &args);
730 client &evalsha(
const std::string &sha1,
int numkeys,
const std::vector<std::string> &keys,
731 const std::vector<std::string> &args,
const reply_callback_t &reply_callback);
733 std::future<reply> evalsha(
const std::string &sha1,
int numkeys,
const std::vector<std::string> &keys,
734 const std::vector<std::string> &args);
738 std::future<reply> exec();
742 std::future<reply> exists(
const std::vector<std::string> &keys);
746 std::future<reply> expire(
const std::string &key,
int seconds);
750 std::future<reply> expireat(
const std::string &key,
int timestamp);
754 std::future<reply> flushall();
758 std::future<reply> flushdb();
760 client &geoadd(
const std::string &key,
761 const std::vector<std::tuple<std::string, std::string, std::string>> &long_lat_memb,
764 std::future<reply> geoadd(
const std::string &key,
765 const std::vector<std::tuple<std::string, std::string, std::string>> &long_lat_memb);
768 geohash(
const std::string &key,
const std::vector<std::string> &members,
const reply_callback_t &reply_callback);
770 std::future<reply> geohash(
const std::string &key,
const std::vector<std::string> &members);
773 geopos(
const std::string &key,
const std::vector<std::string> &members,
const reply_callback_t &reply_callback);
775 std::future<reply> geopos(
const std::string &key,
const std::vector<std::string> &members);
777 client &geodist(
const std::string &key,
const std::string &member_1,
const std::string &member_2,
781 geodist(
const std::string &key,
const std::string &member_1,
const std::string &member_2,
const std::string &unit,
784 std::future<reply> geodist(
const std::string &key,
const std::string &member_1,
const std::string &member_2,
785 const std::string &unit =
"m_cv_mutex");
787 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
788 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
791 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
792 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
795 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
796 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
const std::string &store_key,
799 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
800 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
const std::string &store_key,
803 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
804 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
807 client &georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
808 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
809 const std::string &store_key,
const std::string &storedist_key,
813 georadius(
const std::string &key,
double longitude,
double latitude,
double radius,
geo_unit unit,
814 bool with_coord =
false,
bool with_dist =
false,
bool with_hash =
false,
bool asc_order =
false,
815 std::size_t count = 0,
const std::string &store_key =
"",
const std::string &storedist_key =
"");
817 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
818 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
821 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
822 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
825 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
826 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
829 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
830 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order,
831 const std::string &store_key,
const std::string &storedist_key,
834 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
835 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
838 client &georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
839 bool with_coord,
bool with_dist,
bool with_hash,
bool asc_order, std::size_t count,
840 const std::string &store_key,
const std::string &storedist_key,
844 georadiusbymember(
const std::string &key,
const std::string &member,
double radius,
geo_unit unit,
845 bool with_coord =
false,
bool with_dist =
false,
bool with_hash =
false,
bool asc_order =
false,
846 std::size_t count = 0,
const std::string &store_key =
"",
847 const std::string &storedist_key =
"");
851 std::future<reply>
get(
const std::string &key);
855 std::future<reply> getbit(
const std::string &key,
int offset);
859 std::future<reply> getrange(
const std::string &key,
int start,
int end);
863 std::future<reply> getset(
const std::string &key,
const std::string &val);
866 hdel(
const std::string &key,
const std::vector<std::string> &fields,
const reply_callback_t &reply_callback);
868 std::future<reply> hdel(
const std::string &key,
const std::vector<std::string> &fields);
870 client &hexists(
const std::string &key,
const std::string &field,
const reply_callback_t &reply_callback);
872 std::future<reply> hexists(
const std::string &key,
const std::string &field);
876 std::future<reply> hget(
const std::string &key,
const std::string &field);
880 std::future<reply> hgetall(
const std::string &key);
883 hincrby(
const std::string &key,
const std::string &field,
int incr,
const reply_callback_t &reply_callback);
885 std::future<reply> hincrby(
const std::string &key,
const std::string &field,
int incr);
887 client &hincrbyfloat(
const std::string &key,
const std::string &field,
float incr,
890 std::future<reply> hincrbyfloat(
const std::string &key,
const std::string &field,
float incr);
894 std::future<reply> hkeys(
const std::string &key);
898 std::future<reply> hlen(
const std::string &key);
901 hmget(
const std::string &key,
const std::vector<std::string> &fields,
const reply_callback_t &reply_callback);
903 std::future<reply> hmget(
const std::string &key,
const std::vector<std::string> &fields);
905 client &hmset(
const std::string &key,
const std::vector<std::pair<std::string, std::string>> &field_val,
909 hmset(
const std::string &key,
const std::vector<std::pair<std::string, std::string>> &field_val);
913 std::future<reply> hscan(
const std::string &key, std::size_t cursor);
915 client &hscan(
const std::string &key, std::size_t cursor,
const std::string &pattern,
918 std::future<reply> hscan(
const std::string &key, std::size_t cursor,
const std::string &pattern);
921 hscan(
const std::string &key, std::size_t cursor, std::size_t count,
const reply_callback_t &reply_callback);
923 std::future<reply> hscan(
const std::string &key, std::size_t cursor, std::size_t count);
925 client &hscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count,
929 hscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count);
931 client &hset(
const std::string &key,
const std::string &field,
const std::string &value,
934 std::future<reply> hset(
const std::string &key,
const std::string &field,
const std::string &value);
936 client &hsetnx(
const std::string &key,
const std::string &field,
const std::string &value,
939 std::future<reply> hsetnx(
const std::string &key,
const std::string &field,
const std::string &value);
941 client &hstrlen(
const std::string &key,
const std::string &field,
const reply_callback_t &reply_callback);
943 std::future<reply> hstrlen(
const std::string &key,
const std::string &field);
947 std::future<reply> hvals(
const std::string &key);
951 std::future<reply> incr(
const std::string &key);
955 std::future<reply> incrby(
const std::string &key,
int incr);
959 std::future<reply> incrbyfloat(
const std::string &key,
float incr);
965 std::future<reply> info(
const std::string §ion =
"default");
969 std::future<reply> keys(
const std::string &pattern);
973 std::future<reply> lastsave();
977 std::future<reply> lindex(
const std::string &key,
int index);
979 client &linsert(
const std::string &key,
const std::string &before_after,
const std::string &pivot,
982 std::future<reply> linsert(
const std::string &key,
const std::string &before_after,
const std::string &pivot,
983 const std::string &value);
987 std::future<reply> llen(
const std::string &key);
991 std::future<reply> lpop(
const std::string &key);
994 lpush(
const std::string &key,
const std::vector<std::string> &values,
const reply_callback_t &reply_callback);
996 std::future<reply> lpush(
const std::string &key,
const std::vector<std::string> &values);
1000 std::future<reply> lpushx(
const std::string &key,
const std::string &value);
1004 std::future<reply> lrange(
const std::string &key,
int start,
int stop);
1006 client &lrem(
const std::string &key,
int count,
const std::string &value,
const reply_callback_t &reply_callback);
1008 std::future<reply> lrem(
const std::string &key,
int count,
const std::string &value);
1010 client &lset(
const std::string &key,
int index,
const std::string &value,
const reply_callback_t &reply_callback);
1012 std::future<reply> lset(
const std::string &key,
int index,
const std::string &value);
1016 std::future<reply> ltrim(
const std::string &key,
int start,
int stop);
1020 std::future<reply> mget(
const std::vector<std::string> &keys);
1023 migrate(
const std::string &host,
int port,
const std::string &key,
const std::string &dest_db,
int timeout,
1027 migrate(
const std::string &host,
int port,
const std::string &key,
const std::string &dest_db,
int timeout,
1028 bool copy,
bool replace,
const std::vector<std::string> &keys,
const reply_callback_t &reply_callback);
1031 migrate(
const std::string &host,
int port,
const std::string &key,
const std::string &dest_db,
int timeout,
1032 bool copy =
false,
bool replace =
false,
const std::vector<std::string> &keys = {});
1036 std::future<reply> monitor();
1040 std::future<reply> move(
const std::string &key,
const std::string &db);
1043 mset(
const std::vector<std::pair<std::string, std::string>> &key_vals,
const reply_callback_t &reply_callback);
1045 std::future<reply> mset(
const std::vector<std::pair<std::string, std::string>> &key_vals);
1048 msetnx(
const std::vector<std::pair<std::string, std::string>> &key_vals,
const reply_callback_t &reply_callback);
1050 std::future<reply> msetnx(
const std::vector<std::pair<std::string, std::string>> &key_vals);
1054 std::future<reply> multi();
1056 client &object(
const std::string &subcommand,
const std::vector<std::string> &args,
1059 std::future<reply> object(
const std::string &subcommand,
const std::vector<std::string> &args);
1063 std::future<reply> persist(
const std::string &key);
1067 std::future<reply> pexpire(
const std::string &key,
int ms);
1071 std::future<reply> pexpireat(
const std::string &key,
int ms_timestamp);
1074 pfadd(
const std::string &key,
const std::vector<std::string> &elements,
const reply_callback_t &reply_callback);
1076 std::future<reply> pfadd(
const std::string &key,
const std::vector<std::string> &elements);
1080 std::future<reply> pfcount(
const std::vector<std::string> &keys);
1082 client &pfmerge(
const std::string &destkey,
const std::vector<std::string> &sourcekeys,
1085 std::future<reply> pfmerge(
const std::string &destkey,
const std::vector<std::string> &sourcekeys);
1089 std::future<reply> ping();
1093 std::future<reply> ping(
const std::string &message);
1096 psetex(
const std::string &key,
int ms,
const std::string &val,
const reply_callback_t &reply_callback);
1098 std::future<reply> psetex(
const std::string &key,
int ms,
const std::string &val);
1100 client &publish(
const std::string &channel,
const std::string &message,
const reply_callback_t &reply_callback);
1102 std::future<reply> publish(
const std::string &channel,
const std::string &message);
1104 client &pubsub(
const std::string &subcommand,
const std::vector<std::string> &args,
1107 std::future<reply> pubsub(
const std::string &subcommand,
const std::vector<std::string> &args);
1111 std::future<reply> pttl(
const std::string &key);
1115 std::future<reply> quit();
1119 std::future<reply> randomkey();
1123 std::future<reply> readonly();
1127 std::future<reply> readwrite();
1129 client &rename(
const std::string &key,
const std::string &newkey,
const reply_callback_t &reply_callback);
1131 std::future<reply> rename(
const std::string &key,
const std::string &newkey);
1133 client &renamenx(
const std::string &key,
const std::string &newkey,
const reply_callback_t &reply_callback);
1135 std::future<reply> renamenx(
const std::string &key,
const std::string &newkey);
1137 client &restore(
const std::string &key,
int ttl,
const std::string &serialized_value,
1140 std::future<reply> restore(
const std::string &key,
int ttl,
const std::string &serialized_value);
1142 client &restore(
const std::string &key,
int ttl,
const std::string &serialized_value,
const std::string &replace,
1146 restore(
const std::string &key,
int ttl,
const std::string &serialized_value,
const std::string &replace);
1150 std::future<reply> role();
1154 std::future<reply> rpop(
const std::string &key);
1157 rpoplpush(
const std::string &source,
const std::string &destination,
const reply_callback_t &reply_callback);
1159 std::future<reply> rpoplpush(
const std::string &src,
const std::string &dst);
1162 rpush(
const std::string &key,
const std::vector<std::string> &values,
const reply_callback_t &reply_callback);
1164 std::future<reply> rpush(
const std::string &key,
const std::vector<std::string> &values);
1166 client &rpushx(
const std::string &key,
const std::string &value,
const reply_callback_t &reply_callback);
1168 std::future<reply> rpushx(
const std::string &key,
const std::string &value);
1171 sadd(
const std::string &key,
const std::vector<std::string> &members,
const reply_callback_t &reply_callback);
1173 std::future<reply> sadd(
const std::string &key,
const std::vector<std::string> &members);
1177 std::future<reply> save();
1181 std::future<reply> scan(std::size_t cursor);
1185 std::future<reply> scan(std::size_t cursor,
const std::string &pattern);
1189 std::future<reply> scan(std::size_t cursor, std::size_t count);
1192 scan(std::size_t cursor,
const std::string &pattern, std::size_t count,
const reply_callback_t &reply_callback);
1194 std::future<reply> scan(std::size_t cursor,
const std::string &pattern, std::size_t count);
1198 std::future<reply> scard(
const std::string &key);
1202 std::future<reply> script_debug(
const std::string &mode);
1206 std::future<reply> script_exists(
const std::vector<std::string> &scripts);
1210 std::future<reply> script_flush();
1214 std::future<reply> script_kill();
1218 std::future<reply> script_load(
const std::string &script);
1222 std::future<reply> sdiff(
const std::vector<std::string> &keys);
1224 client &sdiffstore(
const std::string &destination,
const std::vector<std::string> &keys,
1227 std::future<reply> sdiffstore(
const std::string &dst,
const std::vector<std::string> &keys);
1231 std::future<reply> select(
int index);
1235 std::future<reply>
set(
const std::string &key,
const std::string &value);
1237 client &set_advanced(
const std::string &key,
const std::string &value,
const reply_callback_t &reply_callback);
1239 client &set_advanced(
const std::string &key,
const std::string &value,
bool ex,
int ex_sec,
bool px,
int px_milli,
1243 set_advanced(
const std::string &key,
const std::string &value,
bool ex =
false,
int ex_sec = 0,
bool px =
false,
1244 int px_milli = 0,
bool nx =
false,
bool xx =
false);
1247 setbit_(
const std::string &key,
int offset,
const std::string &value,
const reply_callback_t &reply_callback);
1249 std::future<reply> setbit_(
const std::string &key,
int offset,
const std::string &value);
1252 setex(
const std::string &key,
int seconds,
const std::string &value,
const reply_callback_t &reply_callback);
1254 std::future<reply> setex(
const std::string &key,
int seconds,
const std::string &value);
1258 std::future<reply> setnx(
const std::string &key,
const std::string &value);
1261 setrange(
const std::string &key,
int offset,
const std::string &value,
const reply_callback_t &reply_callback);
1263 std::future<reply> setrange(
const std::string &key,
int offset,
const std::string &value);
1267 std::future<reply> shutdown();
1271 std::future<reply> shutdown(
const std::string &save);
1275 std::future<reply> sinter(
const std::vector<std::string> &keys);
1277 client &sinterstore(
const std::string &destination,
const std::vector<std::string> &keys,
1280 std::future<reply> sinterstore(
const std::string &dst,
const std::vector<std::string> &keys);
1282 client &sismember(
const std::string &key,
const std::string &member,
const reply_callback_t &reply_callback);
1284 std::future<reply> sismember(
const std::string &key,
const std::string &member);
1288 std::future<reply> slaveof(
const std::string &host,
int port);
1292 std::future<reply> slowlog(
const std::string &subcommand);
1295 slowlog(std::string subcommand,
const std::string &argument,
const reply_callback_t &reply_callback);
1297 std::future<reply> slowlog(
const std::string &subcommand,
const std::string &argument);
1301 std::future<reply> smembers(
const std::string &key);
1303 client &smove(
const std::string &source,
const std::string &destination,
const std::string &member,
1306 std::future<reply> smove(
const std::string &src,
const std::string &dst,
const std::string &member);
1310 std::future<reply> sort(
const std::string &key);
1312 client &sort(
const std::string &key,
const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
1316 sort(
const std::string &key,
const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha);
1319 sort(
const std::string &key, std::size_t offset, std::size_t count,
const std::vector<std::string> &get_patterns,
1323 sort(
const std::string &key, std::size_t offset, std::size_t count,
const std::vector<std::string> &get_patterns,
1324 bool asc_order,
bool alpha);
1326 client &sort(
const std::string &key,
const std::string &by_pattern,
const std::vector<std::string> &get_patterns,
1330 sort(
const std::string &key,
const std::string &by_pattern,
const std::vector<std::string> &get_patterns,
1331 bool asc_order,
bool alpha);
1333 client &sort(
const std::string &key,
const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
1337 sort(
const std::string &key,
const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
1338 const std::string &store_dest);
1341 sort(
const std::string &key, std::size_t offset, std::size_t count,
const std::vector<std::string> &get_patterns,
1342 bool asc_order,
bool alpha,
const std::string &store_dest,
const reply_callback_t &reply_callback);
1345 sort(
const std::string &key, std::size_t offset, std::size_t count,
const std::vector<std::string> &get_patterns,
1346 bool asc_order,
bool alpha,
const std::string &store_dest);
1348 client &sort(
const std::string &key,
const std::string &by_pattern,
const std::vector<std::string> &get_patterns,
1349 bool asc_order,
bool alpha,
const std::string &store_dest,
const reply_callback_t &reply_callback);
1352 sort(
const std::string &key,
const std::string &by_pattern,
const std::vector<std::string> &get_patterns,
1353 bool asc_order,
bool alpha,
const std::string &store_dest);
1355 client &sort(
const std::string &key,
const std::string &by_pattern, std::size_t offset, std::size_t count,
1356 const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
1360 sort(
const std::string &key,
const std::string &by_pattern, std::size_t offset, std::size_t count,
1361 const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha);
1363 client &sort(
const std::string &key,
const std::string &by_pattern, std::size_t offset, std::size_t count,
1364 const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
1368 sort(
const std::string &key,
const std::string &by_pattern, std::size_t offset, std::size_t count,
1369 const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
const std::string &store_dest);
1373 std::future<reply> spop(
const std::string &key);
1377 std::future<reply> spop(
const std::string &key,
int count);
1381 std::future<reply> srandmember(
const std::string &key);
1385 std::future<reply> srandmember(
const std::string &key,
int count);
1388 srem(
const std::string &key,
const std::vector<std::string> &members,
const reply_callback_t &reply_callback);
1390 std::future<reply> srem(
const std::string &key,
const std::vector<std::string> &members);
1394 std::future<reply> sscan(
const std::string &key, std::size_t cursor);
1396 client &sscan(
const std::string &key, std::size_t cursor,
const std::string &pattern,
1399 std::future<reply> sscan(
const std::string &key, std::size_t cursor,
const std::string &pattern);
1402 sscan(
const std::string &key, std::size_t cursor, std::size_t count,
const reply_callback_t &reply_callback);
1404 std::future<reply> sscan(
const std::string &key, std::size_t cursor, std::size_t count);
1406 client &sscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count,
1410 sscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count);
1414 std::future<reply> strlen(
const std::string &key);
1418 std::future<reply> sunion(
const std::vector<std::string> &keys);
1420 client &sunionstore(
const std::string &destination,
const std::vector<std::string> &keys,
1423 std::future<reply> sunionstore(
const std::string &dst,
const std::vector<std::string> &keys);
1427 std::future<reply> sync();
1431 std::future<reply> time();
1435 std::future<reply> ttl(
const std::string &key);
1439 std::future<reply> type(
const std::string &key);
1443 std::future<reply> unwatch();
1447 std::future<reply> wait(
int numslaves,
int timeout);
1451 std::future<reply> watch(
const std::vector<std::string> &keys);
1453 client &xack(
const std::string &key,
const std::string &group,
const std::vector<std::string> &id_members,
1457 xack(
const std::string &key,
const std::string &group,
const std::vector<std::string> &id_members);
1460 xadd(
const std::string &key,
const std::string &
id,
const std::multimap<std::string, std::string> &field_members,
1464 xadd(
const std::string &key,
const std::string &
id,
const std::multimap<std::string, std::string> &field_members);
1466 client &xclaim(
const std::string &key,
const std::string &group,
const std::string &consumer,
int min_idle_time,
1467 const std::vector<std::string> &id_members,
const reply_callback_t &reply_callback);
1470 xclaim(
const std::string &key,
const std::string &group,
const std::string &consumer,
const int &min_idle_time,
1471 const std::vector<std::string> &id_members);
1474 xdel(
const std::string &key,
const std::vector<std::string> &id_members,
const reply_callback_t &reply_callback);
1476 std::future<reply> xdel(
const std::string &key,
const std::vector<std::string> &id_members);
1479 xgroup_create(
const std::string &key,
const std::string &group_name,
const reply_callback_t &reply_callback);
1482 xgroup_create(
const std::string &key,
const std::string &group_name,
const std::string &
id,
1486 xgroup_create(
const std::string &key,
const std::string &group_name,
const std::string &
id =
"$");
1489 xgroup_set_id(
const std::string &key,
const std::string &group_name,
const reply_callback_t &reply_callback);
1492 xgroup_set_id(
const std::string &key,
const std::string &group_name,
const std::string &
id,
1496 xgroup_set_id(
const std::string &key,
const std::string &group_name,
const std::string &
id =
"$");
1499 xgroup_destroy(
const std::string &key,
const std::string &group_name,
const reply_callback_t &reply_callback);
1501 std::future<reply> xgroup_destroy(
const std::string &key,
const std::string &group_name);
1504 xgroup_del_consumer(
const std::string &key,
const std::string &group_name,
const std::string &consumer_name,
1508 xgroup_del_consumer(
const std::string &key,
const std::string &group_name,
const std::string &consumer_name);
1524 std::future<reply>
xinfo_consumers(
const std::string &key,
const std::string &group_name);
1539 std::future<reply>
xinfo_groups(
const std::string &key);
1542 std::future<reply> xinfo_stream(
const std::string &key);
1559 std::future<reply>
xlen(
const std::string &key);
1561 client &zadd(
const std::string &key,
const std::vector<std::string> &options,
1562 const std::multimap<std::string, std::string> &score_members,
1565 std::future<reply> zadd(
const std::string &key,
const std::vector<std::string> &options,
1566 const std::multimap<std::string, std::string> &score_members);
1570 std::future<reply> zcard(
const std::string &key);
1574 std::future<reply> zcount(
const std::string &key,
int min,
int max);
1578 std::future<reply> zcount(
const std::string &key,
double min,
double max);
1580 client &zcount(
const std::string &key,
const std::string &min,
const std::string &max,
1583 std::future<reply> zcount(
const std::string &key,
const std::string &min,
const std::string &max);
1586 zincrby(
const std::string &key,
int incr,
const std::string &member,
const reply_callback_t &reply_callback);
1588 std::future<reply> zincrby(
const std::string &key,
int incr,
const std::string &member);
1591 zincrby(
const std::string &key,
double incr,
const std::string &member,
const reply_callback_t &reply_callback);
1593 std::future<reply> zincrby(
const std::string &key,
double incr,
const std::string &member);
1595 client &zincrby(
const std::string &key,
const std::string &incr,
const std::string &member,
1598 std::future<reply> zincrby(
const std::string &key,
const std::string &incr,
const std::string &member);
1600 client &zinterstore(
const std::string &destination, std::size_t numkeys,
const std::vector<std::string> &keys,
1605 zinterstore(
const std::string &destination, std::size_t numkeys,
const std::vector<std::string> &keys,
1610 std::future<reply> zlexcount(
const std::string &key,
int min,
int max);
1612 client &zlexcount(
const std::string &key,
double min,
double max,
const reply_callback_t &reply_callback);
1614 std::future<reply> zlexcount(
const std::string &key,
double min,
double max);
1616 client &zlexcount(
const std::string &key,
const std::string &min,
const std::string &max,
1619 std::future<reply> zlexcount(
const std::string &key,
const std::string &min,
const std::string &max);
1624 zrange(
const std::string &key,
int start,
int stop,
bool withscores,
const reply_callback_t &reply_callback);
1626 std::future<reply> zrange(
const std::string &key,
int start,
int stop,
bool withscores =
false);
1628 client &zrange(
const std::string &key,
double start,
double stop,
const reply_callback_t &reply_callback);
1630 client &zrange(
const std::string &key,
double start,
double stop,
bool withscores,
1633 std::future<reply> zrange(
const std::string &key,
double start,
double stop,
bool withscores =
false);
1635 client &zrange(
const std::string &key,
const std::string &start,
const std::string &stop,
1638 client &zrange(
const std::string &key,
const std::string &start,
const std::string &stop,
bool withscores,
1642 zrange(
const std::string &key,
const std::string &start,
const std::string &stop,
bool withscores =
false);
1647 zrangebylex(
const std::string &key,
int min,
int max,
bool withscores,
const reply_callback_t &reply_callback);
1649 std::future<reply> zrangebylex(
const std::string &key,
int min,
int max,
bool withscores =
false);
1651 client &zrangebylex(
const std::string &key,
double min,
double max,
const reply_callback_t &reply_callback);
1653 client &zrangebylex(
const std::string &key,
double min,
double max,
bool withscores,
1656 std::future<reply> zrangebylex(
const std::string &key,
double min,
double max,
bool withscores =
false);
1658 client &zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max,
1661 client &zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max,
bool withscores,
1665 zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max,
bool withscores =
false);
1667 client &zrangebylex(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
1671 zrangebylex(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
bool withscores,
1674 std::future<reply> zrangebylex(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
1675 bool withscores =
false);
1677 client &zrangebylex(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1680 client &zrangebylex(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1684 zrangebylex(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1685 bool withscores =
false);
1687 client &zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1690 client &zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1691 std::size_t count,
bool withscores,
const reply_callback_t &reply_callback);
1694 zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1695 std::size_t count,
bool withscores =
false);
1700 zrangebyscore(
const std::string &key,
int min,
int max,
bool withscores,
const reply_callback_t &reply_callback);
1702 std::future<reply> zrangebyscore(
const std::string &key,
int min,
int max,
bool withscores =
false);
1704 client &zrangebyscore(
const std::string &key,
double min,
double max,
const reply_callback_t &reply_callback);
1706 client &zrangebyscore(
const std::string &key,
double min,
double max,
bool withscores,
1709 std::future<reply> zrangebyscore(
const std::string &key,
double min,
double max,
bool withscores =
false);
1711 client &zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max,
1714 client &zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max,
bool withscores,
1718 zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max,
bool withscores =
false);
1720 client &zrangebyscore(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
1724 zrangebyscore(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
bool withscores,
1727 std::future<reply> zrangebyscore(
const std::string &key,
int min,
int max, std::size_t offset, std::size_t count,
1728 bool withscores =
false);
1730 client &zrangebyscore(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1733 client &zrangebyscore(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1737 zrangebyscore(
const std::string &key,
double min,
double max, std::size_t offset, std::size_t count,
1738 bool withscores =
false);
1740 client &zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1743 client &zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1744 std::size_t count,
bool withscores,
const reply_callback_t &reply_callback);
1747 zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max, std::size_t offset,
1748 std::size_t count,
bool withscores =
false);
1750 client &zrank(
const std::string &key,
const std::string &member,
const reply_callback_t &reply_callback);
1752 std::future<reply> zrank(
const std::string &key,
const std::string &member);
1755 zrem(
const std::string &key,
const std::vector<std::string> &members,
const reply_callback_t &reply_callback);
1757 std::future<reply> zrem(
const std::string &key,
const std::vector<std::string> &members);
1759 client &zremrangebylex(
const std::string &key,
int min,
int max,
const reply_callback_t &reply_callback);
1761 std::future<reply> zremrangebylex(
const std::string &key,
int min,
int max);
1763 client &zremrangebylex(
const std::string &key,
double min,
double max,
const reply_callback_t &reply_callback);
1765 std::future<reply> zremrangebylex(
const std::string &key,
double min,
double max);
1767 client &zremrangebylex(
const std::string &key,
const std::string &min,
const std::string &max,
1770 std::future<reply> zremrangebylex(
const std::string &key,
const std::string &min,
const std::string &max);
1772 client &zremrangebyrank(
const std::string &key,
int start,
int stop,
const reply_callback_t &reply_callback);
1774 std::future<reply> zremrangebyrank(
const std::string &key,
int start,
int stop);
1777 zremrangebyrank(
const std::string &key,
double start,
double stop,
const reply_callback_t &reply_callback);
1779 std::future<reply> zremrangebyrank(
const std::string &key,
double start,
double stop);
1781 client &zremrangebyrank(
const std::string &key,
const std::string &start,
const std::string &stop,
1784 std::future<reply> zremrangebyrank(
const std::string &key,
const std::string &start,
const std::string &stop);
1786 client &zremrangebyscore(
const std::string &key,
int min,
int max,
const reply_callback_t &reply_callback);
1788 std::future<reply> zremrangebyscore(
const std::string &key,
int min,
int max);
1790 client &zremrangebyscore(
const std::string &key,
double min,
double max,
const reply_callback_t &reply_callback);
1792 std::future<reply> zremrangebyscore(
const std::string &key,
double min,
double max);
1794 client &zremrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max,
1797 std::future<reply> zremrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max);
1802 zrevrange(
const std::string &key,
int start,
int stop,
bool withscores,
const reply_callback_t &reply_callback);
1804 std::future<reply> zrevrange(
const std::string &key,
int start,
int stop,
bool withscores =
false);
1806 client &zrevrange(
const std::string &key,
double start,
double stop,
const reply_callback_t &reply_callback);
1808 client &zrevrange(
const std::string &key,
double start,
double stop,
bool withscores,
1811 std::future<reply> zrevrange(
const std::string &key,
double start,
double stop,
bool withscores =
false);
1813 client &zrevrange(
const std::string &key,
const std::string &start,
const std::string &stop,
1816 client &zrevrange(
const std::string &key,
const std::string &start,
const std::string &stop,
bool withscores,
1820 zrevrange(
const std::string &key,
const std::string &start,
const std::string &stop,
bool withscores =
false);
1822 client &zrevrangebylex(
const std::string &key,
int max,
int min,
const reply_callback_t &reply_callback);
1825 zrevrangebylex(
const std::string &key,
int max,
int min,
bool withscores,
const reply_callback_t &reply_callback);
1827 std::future<reply> zrevrangebylex(
const std::string &key,
int max,
int min,
bool withscores =
false);
1829 client &zrevrangebylex(
const std::string &key,
double max,
double min,
const reply_callback_t &reply_callback);
1831 client &zrevrangebylex(
const std::string &key,
double max,
double min,
bool withscores,
1834 std::future<reply> zrevrangebylex(
const std::string &key,
double max,
double min,
bool withscores =
false);
1836 client &zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min,
1839 client &zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min,
bool withscores,
1843 zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min,
bool withscores =
false);
1845 client &zrevrangebylex(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
1849 zrevrangebylex(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
bool withscores,
1852 std::future<reply> zrevrangebylex(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
1853 bool withscores =
false);
1855 client &zrevrangebylex(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1858 client &zrevrangebylex(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1862 zrevrangebylex(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1863 bool withscores =
false);
1865 client &zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1868 client &zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1869 std::size_t count,
bool withscores,
const reply_callback_t &reply_callback);
1872 zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1873 std::size_t count,
bool withscores =
false);
1875 client &zrevrangebyscore(
const std::string &key,
int max,
int min,
const reply_callback_t &reply_callback);
1877 client &zrevrangebyscore(
const std::string &key,
int max,
int min,
bool withscores,
1880 std::future<reply> zrevrangebyscore(
const std::string &key,
int max,
int min,
bool withscores =
false);
1882 client &zrevrangebyscore(
const std::string &key,
double max,
double min,
const reply_callback_t &reply_callback);
1884 client &zrevrangebyscore(
const std::string &key,
double max,
double min,
bool withscores,
1887 std::future<reply> zrevrangebyscore(
const std::string &key,
double max,
double min,
bool withscores =
false);
1889 client &zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min,
1892 client &zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min,
bool withscores,
1896 zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min,
bool withscores =
false);
1898 client &zrevrangebyscore(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
1902 zrevrangebyscore(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
bool withscores,
1906 zrevrangebyscore(
const std::string &key,
int max,
int min, std::size_t offset, std::size_t count,
1907 bool withscores =
false);
1909 client &zrevrangebyscore(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1912 client &zrevrangebyscore(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1916 zrevrangebyscore(
const std::string &key,
double max,
double min, std::size_t offset, std::size_t count,
1917 bool withscores =
false);
1920 zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1924 zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1925 std::size_t count,
bool withscores,
const reply_callback_t &reply_callback);
1928 zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min, std::size_t offset,
1929 std::size_t count,
bool withscores =
false);
1931 client &zrevrank(
const std::string &key,
const std::string &member,
const reply_callback_t &reply_callback);
1933 std::future<reply> zrevrank(
const std::string &key,
const std::string &member);
1937 std::future<reply> zscan(
const std::string &key, std::size_t cursor);
1939 client &zscan(
const std::string &key, std::size_t cursor,
const std::string &pattern,
1942 std::future<reply> zscan(
const std::string &key, std::size_t cursor,
const std::string &pattern);
1945 zscan(
const std::string &key, std::size_t cursor, std::size_t count,
const reply_callback_t &reply_callback);
1947 std::future<reply> zscan(
const std::string &key, std::size_t cursor, std::size_t count);
1949 client &zscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count,
1953 zscan(
const std::string &key, std::size_t cursor,
const std::string &pattern, std::size_t count);
1955 client &zscore(
const std::string &key,
const std::string &member,
const reply_callback_t &reply_callback);
1957 std::future<reply> zscore(
const std::string &key,
const std::string &member);
1959 client &zunionstore(
const std::string &destination, std::size_t numkeys,
const std::vector<std::string> &keys,
1964 zunionstore(
const std::string &destination, std::size_t numkeys,
const std::vector<std::string> &keys,
1969 template<
typename T>
1970 typename std::enable_if<std::is_same<T, client_type>::value>::type
1973 template<
typename T>
1974 typename std::enable_if<std::is_same<T, bool>::value>::type
1975 client_kill_unpack_arg(std::vector<std::string> &redis_cmd,
reply_callback_t &,
bool skip);
1977 template<
typename T>
1978 typename std::enable_if<std::is_integral<T>::value>::type
1979 client_kill_unpack_arg(std::vector<std::string> &redis_cmd,
reply_callback_t &, uint64_t
id);
1981 template<
typename T>
1982 typename std::enable_if<std::is_class<T>::value>::type
1983 client_kill_unpack_arg(std::vector<std::string> &,
reply_callback_t &reply_callback,
const T &cb);
1985 template<
typename T,
typename... Ts>
1987 client_kill_impl(std::vector<std::string> &redis_cmd,
reply_callback_t &
reply,
const T &arg,
const Ts &... args);
1989 template<
typename T>
1996 sort(
const std::string &key,
const std::string &by_pattern,
bool limit, std::size_t offset, std::size_t count,
1997 const std::vector<std::string> &get_patterns,
bool asc_order,
bool alpha,
const std::string &store_dest,
2001 client &zrevrangebyscore(
const std::string &key,
const std::string &max,
const std::string &min,
bool limit,
2002 std::size_t offset, std::size_t count,
bool withscores,
2006 client &zrangebyscore(
const std::string &key,
const std::string &min,
const std::string &max,
bool limit,
2007 std::size_t offset, std::size_t count,
bool withscores,
2011 client &zrevrangebylex(
const std::string &key,
const std::string &max,
const std::string &min,
bool limit,
2012 std::size_t offset, std::size_t count,
bool withscores,
2016 client &zrangebylex(
const std::string &key,
const std::string &min,
const std::string &max,
bool limit,
2017 std::size_t offset, std::size_t count,
bool withscores,
2039 void clear_callbacks();
2054 struct command_request {
2055 std::vector<std::string> command;
2063 std::string m_redis_server;
2067 std::size_t m_redis_port = 0;
2071 std::string m_master_name;
2075 std::string m_password;
2079 int m_database_index = 0;
2084 network::redis_connection m_client;
2094 std::uint32_t m_connect_timeout_ms = 0;
2098 std::int32_t m_max_reconnects = 0;
2102 std::int32_t m_current_reconnect_attempts = 0;
2106 std::uint32_t m_reconnect_interval_ms = 0;
2111 std::atomic_bool m_reconnecting;
2115 std::atomic_bool m_cancel;
2120 std::queue<command_request> m_commands;
2130 std::mutex m_callbacks_mutex;
2135 std::condition_variable m_sync_condvar;
2140 std::atomic<unsigned int> m_callbacks_running;
2145 #include <cpp_redis/impl/client.ipp> Definition: redis_connection.hpp:45
Definition: client.hpp:48
client & xinfo_consumers(const std::string &key, const std::string &group_name, const reply_callback_t &reply_callback)
introspection command used in order to retrieve different information about the consumer groups ...
std::function< void(reply &)> reply_callback_t
Definition: client.hpp:172
const sentinel & get_sentinel() const
client & operator=(const client &)=delete
assignment operator
Definition: client.hpp:415
client & xlen(const std::string &key, const reply_callback_t &reply_callback)
Returns the number of entries inside a stream. If the specified key does not exist the command return...
geo_unit
Definition: client.hpp:355
bitfield_operation_type operation_type
Definition: client.hpp:419
client & client_kill(const std::string &host, int port, const T &arg, const Ts &... args)
Definition: client.ipp:93
bool is_connected() const
static bitfield_operation incrby(const std::string &type, int offset, int increment, overflow_type overflow=overflow_type::server_default)
bitfield_operation_type
Definition: client.hpp:396
std::string aggregate_method_to_string(aggregate_method method) const
client & sync_commit(const std::chrono::duration< Rep, Period > &timeout)
Definition: client.hpp:220
std::string geo_unit_to_string(geo_unit unit) const
connect_state
Definition: client.hpp:71
void add_sentinel(const std::string &host, std::size_t port, std::uint32_t timeout_ms=0)
std::string type
Definition: client.hpp:424
std::string overflow_type_to_string(overflow_type type) const
void disconnect(bool wait_for_removal=false)
bool is_reconnecting() const
client & send(const std::vector< std::string > &redis_cmd, const reply_callback_t &callback)
Definition: sentinel.hpp:40
std::function< void(const std::string &host, std::size_t port, connect_state status)> connect_callback_t
Definition: client.hpp:109
client & xinfo_groups(const std::string &key, const reply_callback_t &reply_callback)
std::string bitfield_operation_type_to_string(bitfield_operation_type operation) const
overflow_type overflow
Definition: client.hpp:439
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_ms=0, std::int32_t max_reconnects=0, std::uint32_t reconnect_interval_ms=0)
client_type
Definition: client.hpp:54
std::future< reply > client_kill_future(T, const Ts...)
Definition: client.ipp:122
int offset
Definition: client.hpp:429
overflow_type
Definition: client.hpp:376
int value
Definition: client.hpp:434
Definition: array_builder.hpp:29
aggregate_method
Definition: client.hpp:335