The publisher-subscriber design pattern establishes two entities: a publisher that sends messages based on events and a subscriber that subscribes to those events. With this design pattern, publishers transmit messages and subscribers listen for them and then take the appropriate action or inaction.
As illustrated next, the Publisher publishes events. The Subscribers subscribe to the events. Once an event is heard, the Subscriber provides the computation or processing as appropriate for the event:
This design pattern is event-driven and can be implemented by using the event-driven architecture, the observer pattern, and the message broker pattern, covered in previous chapters of this book.
This section provided a brief overview of the publisher-subscriber design pattern.
...