Skip to content

Instantly share code, notes, and snippets.

@jordancardwell
Last active April 12, 2017 20:02
Show Gist options
  • Save jordancardwell/b50ccc2354c083988efd59482c7b8826 to your computer and use it in GitHub Desktop.
Save jordancardwell/b50ccc2354c083988efd59482c7b8826 to your computer and use it in GitHub Desktop.
var appname = 'test.event.1'
var bus1 = require('servicebus').bus();
bus1.subscribe(appname, function (event) {
console.log(`1 caught ${event.counter}`);
});
var bus2 = require('servicebus').bus();
bus2.subscribe(appname, function (event) {
console.log(`2 caught ${event.counter}`);
});
var bus3 = require('servicebus').bus();
var counter = 0;
setInterval(function () {
bus3.publish(appname, { counter });
counter++;
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment