I want to use redis pubsub to transmit some messages, but don’t want be blocked using listen, like the code below:
while (true)
{
if (redisGetReply(c, (void **)&reply) == REDIS_OK)
{
// do somethings
.
.
// do somethings
}
// do somethings
}
will be blocked waiting for a message. I want to check if there is a message then do somethings if no message go to next line.
how can I accomplish this?
New contributor
user24822085 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.