Skip to content

Commit

Permalink
Merge pull request ashishps1#20 from lokeshsk1/patch-2
Browse files Browse the repository at this point in the history
Update pub-sub-system.md
  • Loading branch information
ashishps1 authored Jul 17, 2024
2 parents a01353f + 7e51c9f commit 50c8589
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions problems/pub-sub-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
1. The **Message** class represents a message that can be published and received by subscribers. It contains the message content.
2. The **Topic** class represents a topic to which messages can be published. It maintains a set of subscribers and provides methods to add and remove subscribers, as well as publish messages to all subscribers.
3. The **Subscriber** interface defines the contract for subscribers. It declares the onMessage method that is invoked when a subscriber receives a message.
4. The **ConcreteSubscriber** class is a concrete implementation of the Subscriber interface. It receives messages and prints them to the console.
4. The **PrintSubscriber** class is a concrete implementation of the Subscriber interface. It receives messages and prints them to the console.
5. The **Publisher** class represents a publisher that publishes messages to a specific topic.
6. The **PubSubSystem** class is the main class that manages topics, subscribers, and message publishing. It uses a ConcurrentHashMap to store topics and an ExecutorService to handle concurrent message publishing.
7. The **PubSubDemo** class demonstrates the usage of the Pub-Sub system by creating topics, subscribers, and publishers, and publishing messages.
7. The **PubSubDemo** class demonstrates the usage of the Pub-Sub system by creating topics, subscribers, and publishers, and publishing messages.

0 comments on commit 50c8589

Please sign in to comment.