Redis exposes a Publish-Subscribe messaging pattern (not so dissimilar to the CouchDB
changes stream), which can be used to listen to specific data change events. Data from these events could be passed between processes to, for instance, instantly update a web app with fresh new data.
With PubSub, we publish a message to a specific channel; this channel can then be picked up by any amount of subscribers. The publishing mechanism doesn't care who's listening or how many are listening; it chats away regardless.
In this recipe, we will create a publishing process and a subscribing process. For the publishing process, we'll extend our
quotes.js file from the previous recipe, Storing and retrieving data with Redis, and ...