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.
I try to use blpop with timeout parameter as the following code:
int main(int argc, char* argv[]) {
cpp_redis::client client;
RedisInfo redis_info;
redis_info.address = "127.0.0.1";
redis_info.port = 6379;
// This function is just init a redis client.
if (!common::InitRedisClient(&client, redis_info)) {
cout << "Establish connection to redis failed" << endl;
return 0;
} else {
cout << "Establish connection to redis succeed" << endl;
}
vector<string> keys;
keys.push_back("test");
client.blpop(keys, 1, [](cpp_redis::reply& reply) {
cout << "Blpop response: " << reply.as_string() << endl;
});
client.sync_commit();
cout << "Blpop timeout" << endl;
return 0;
}
As my understanding, program should print "Blpop timeout" after 1s and there are no data push to test list. But program seem to be block and never end.
Is this expected behavior of blpop command with timeout?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I try to use blpop with timeout parameter as the following code:
As my understanding, program should print "Blpop timeout" after 1s and there are no data push to
test
list. But program seem to be block and never end.Is this expected behavior of blpop command with timeout?
The text was updated successfully, but these errors were encountered: