31 #include <cpp_redis/builders/reply_builder.hpp> 32 #include <cpp_redis/network/tcp_client_iface.hpp> 34 #ifndef __CPP_REDIS_READ_SIZE 35 #define __CPP_REDIS_READ_SIZE 4096 47 #ifndef __CPP_REDIS_USE_CUSTOM_TCP_CLIENT 88 const std::string& host =
"127.0.0.1",
89 std::size_t port = 6379,
90 const disconnection_handler_t& disconnection_handler =
nullptr,
91 const reply_callback_t& reply_callback =
nullptr,
92 std::uint32_t timeout_msecs = 0);
99 void disconnect(
bool wait_for_removal =
false);
137 void tcp_client_disconnection_handler(
void);
143 std::string build_command(
const std::vector<std::string>& redis_cmd);
149 void call_disconnection_handler(
void);
155 std::shared_ptr<cpp_redis::network::tcp_client_iface> m_client;
160 reply_callback_t m_reply_callback;
165 disconnection_handler_t m_disconnection_handler;
175 std::string m_buffer;
180 std::mutex m_buffer_mutex;
void disconnect(bool wait_for_removal=false)
Definition: redis_connection.hpp:45
std::function< void(redis_connection &)> disconnection_handler_t
Definition: redis_connection.hpp:71
std::function< void(redis_connection &, reply &)> reply_callback_t
Definition: redis_connection.hpp:76
redis_connection & send(const std::vector< std::string > &redis_cmd)
bool is_connected(void) const
redis_connection & operator=(const redis_connection &)=delete
assignment operator
void connect(const std::string &host="127.0.0.1", std::size_t port=6379, const disconnection_handler_t &disconnection_handler=nullptr, const reply_callback_t &reply_callback=nullptr, std::uint32_t timeout_msecs=0)
Definition: reply_builder.hpp:40
redis_connection & commit(void)
redis_connection(void)
ctor
~redis_connection(void)
dtor
Definition: tcp_client.hpp:37
Definition: tcp_client_iface.hpp:70
Definition: array_builder.hpp:29