You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2019. It is now read-only.
Bear minimum code
Connect and reconnect code
`void RedisUtil::connect_callback(const std::string& host,
std::size_t port,
cpp_redis::client::connect_state status){
if (status == cpp_redis::client::connect_state::dropped) {
std::unique_lockstd::mutex ulock(m_mutex);
m_con_var.wait(ulock,std::bind(&RedisUtil::is_client_available,this));
release();
while(intialize(host,port)){};
}
}
bool RedisUtil::intialize(const std::string &redis_host , const int redis_port ){
auto conn_call_wrap = std::bind( &RedisUtil::connect_callback,this,_1,_2,_3);
redis_client.connect(redis_host, redis_port,conn_call_wrap);
}`
Redis client get wrapper
I am looking for a better approach, any help will be gratefully welcome.
The text was updated successfully, but these errors were encountered: