Skip to content

Instantly share code, notes, and snippets.

@matomesc
Last active December 20, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matomesc/6208219 to your computer and use it in GitHub Desktop.
Save matomesc/6208219 to your computer and use it in GitHub Desktop.
Gossip MessageStream usage
var stream = hub.sendAll('check-temp');
stream.on('error', function (err) {
// called when there are errors - ex: missing ack / reply timeout
console.log(err);
});
stream.on('ack', function (ackMsg) {
// not sure how useful this is
});
stream.on('acked', function () {
// emitted when all hubs sent back acks
});
stream.on('reply', function (msg) {
// called when a reply is received
console.log(msg);
});
stream.on('end', function () {
// no more messages will be received
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment