PubSubThen
PubSubThen is a synchronous publish/subscribe node.js module.
PubSubThen was developed for the purpose of complete separation of modules in node.js.
PubSubThen supports a synchronous topic publication.
Getting PubSubThen
There are several ways of getting PubSubThen
- Download a tagged version from GitHub
- Install via npm (
npm install pub-sub-then
)
Examples
Basic example
// Requirevar PubSubThen = ; // Add a subscription to topicPubSubThen; // Publish the topicvar list1 = ;var list2 = ;PubSubThen;
Unsubscribe
// Add a subscription to topicvar subscription = PubSubThen; PubSubThen;
Cancel all subscriptions for a message
// Add a subscription to topicPubSubThen; PubSubThen; PubSubThen;
More about Publish/Subscribe
- The Many Faces of Publish/Subscribe (PDF)
- Addy Osmani's mini book on Patterns
- Publish / Subscribe Systems, A summary of 'The Many Faces of Publish / Subscribe'