Yesterday ,
I read Chapter 6 in Redis In Action where Joshua Carlton writes that" One of the drawbacks of the Redis Publish and Subscribe model are that the client
must be connected at all times to receive messages, disconnections can cause
the client to lose messages, and older versions of Redis could become unusable,
crash, or be killed if there was a slow subscriber."
Then, Joshua Carlton states that ,
"Though push messaging can be useful, we run into problems when clients can’t stay
connected all the time for one reason or another. To address this limitation, we’ll write
two different pull messaging methods that can be used as a replacement for
PUBLISH/SUBSCRIBE. We’ll first start with single-recipient messaging, since it shares
much in common with our first-in, first-out queues. Later in this section, we’ll move to a
method where we can have multiple recipients of a message. With multiple recipients,
we can replace Redis PUBLISH and SUBSCRIBE when we need our messages to
get to all recipients, even if they were disconnected"
We are interested to know whether it would be more performant to replace
Redis PUBLISH and SUBSCRIBE with Joshua Carlton's Section 6.5.2
Multiple-recipient publish/subscribe replacement
instead of harnessing the TCP or UDP protocol to detect and repair the disconnection loss.
If one chooses to use Joshua Carlton's Section 6.5.2
Multiple-recipient publish/subscribe replacement there is a race condition
in sending messages which it’s can be handled with the use of a lock or mutex.
What is the nature of that race condition?
Finally , may we use multithreading in conjunction with Joshua Carlton's Section 6.5.2
Multiple-recipient publish/subscribe replacement to harness the processing power
of today's multicore CPUs?