autohost-pubsub
A backbone that allows clients to manage subscriptions to system-wide events.
The intention is that clients can manage what topics they subscribe to via the web socket API or HTTP API.
Web Socket API
// subscribes to a specific topicsocket; // subscribes to any topic beginning with `my`socket; // unsubscribes to a topicsocket;
HTTP API
This example demonstrates using a halon client to make the calls. (because hypermedia makes everything better)
var client = ; clientsubscription; clientsubscription;
Installation & Setup
npm install autohost-pubsub -S
var autohost = ;var host;var hyped = ;var fount = ;var postal = ;// create the channel used to communicate between// a message backbone/app and the pubsub resourcevar channel = postal; fount;host = hyped; // you can plug any message/event backbone into this system using the postal channel// just publish events to the topics as the clients have subscribed to them// and it will handle the rest ... // this example demonstrates how you could forward messages from a rabbit// queue via wascally and use the routing key of the message as the topicrabbit;