Posts

Showing posts from January, 2018

To PubSub or not to PubSub, that is the question

Introduction   The PubSub pattern is quite simple: Publishers can publish messages to channels Subscribers of these channels are able to receive the messages from them There is no knowledge of the publisher about the functionality of any of the subscribers. So they are acting independently. The only thing which glues them together is a message within a channel. Here a very brief example with Redis: Open a session via 'redis-cli' and enter the following command in order to subscribe to a channel with the name 'public'  In another 'redis-cli' session enter the following command in order to publish the message 'Hello world' to the 'public' channel: The result in the first session is: BTW: It's also possible to subscribe to a bunch of channels by using patterns, e.g. `PSUBSCRIBE pub*`    Fire and Forget  If we would start additional subscribers after our experiment then they won't receive the previous message