In the Publisher-Subscriber pattern, publishers publish messages without bothering about who receives it. Similarly, the subscribers can be blissfully unaware of publishers, just consuming messages from topics of interest to them. This pattern is quite commonly confused with other similar patterns like a message queue and observer pattern. However, in both of these, publisher (or producer) is aware of the subscriber (or consumers).
#Pattern #JavaScript #NodeJS #WebSocket
#Pattern #JavaScript #NodeJS #WebSocket
Medium
Implementing Publisher-Subscriber Pattern Using JavaScript, NodeJS and WebSockets
Recently I ticked off an item from my bucket list: Do a quick and dirty implementation of the Publisher-Subscriber pattern.