Skip to content

Pub subs

Course: Redis (Pub subs and Messaging queues) - chapter 7

Publish-subscribe (pub-sub) is a messaging pattern where messages are published to a topic without the knowledge of what or if any subscribers there might be. Similarly, subscribers listen for messages on topics of interest without knowing which publishers are sending them. This decoupling of publishers and subscribers allows for highly scalable and flexible communication systems.

Subscribe to a topic

SUBSCRIBE problems_done

Publishing to a topic

PUBLISH problems_done "{id: 1, ans: 'TLE'}"