Closed sknagappan closed 1 year ago
Subscriber::consume()
does 2 things:
Receiving message and running callback are not run in parallel.
Client does not receive new message until consume
finishes the callback and returns. Only when you call consume
again (normally in a loop), client receives new messages. So there's no messages lost.
Regards
Please also refer to the following thread and comment, regarding the Subscriber
class' thread safety:
https://github.com/sewenew/redis-plus-plus/issues/289#issuecomment-959374839
when the message is received, Subscriber::consume calls the callback function to process the messages, during this time, will sub.consume() continue to receive the message without losing any messages? Assume the callback takes longer time to return, even during this time, messages arriving on channels are in queue and its not dropped? consume() returns after consume() calls the callback on receiving the message. from the time consume() returns and till next consume, what happens to the messages?