Last active
December 20, 2015 22:49
-
-
Save matomesc/6208219 to your computer and use it in GitHub Desktop.
Gossip MessageStream usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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