Guest

Pub Sub

Dec 8th, 2025
33
0
Never
Not a member of gistpad yet? Sign Up, it unlocks many cool features!
None 0.90 KB | Software | 0 0
  1. Design and implement a simple in-memory publish-subscribe system that supports the following features:
  2.  
  3. - Multiple topics: Publishers can publish messages to named topics
  4. - Multiple subscribers: Subscribers can subscribe to one or more topics
  5. - Message delivery: When a message is published to a topic, all subscribers to that topic should receive it
  6. - Unsubscribe capability: Subscribers should be able to unsubscribe from topics
  7. - Wildcard subscriptions (bonus): Support pattern matching like "user.*" to subscribe to "user.created", "user.deleted", etc.
RAW Gist Data Copied