Skip to content

Instantly share code, notes, and snippets.

@matomesc

matomesc/gossip_stream.js

Last active Dec 20, 2015
Embed
What would you like to do?
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