Skip to content

Instantly share code, notes, and snippets.

@jcrugzz
Last active December 21, 2015 12:09
Show Gist options
  • Save jcrugzz/6304245 to your computer and use it in GitHub Desktop.
Save jcrugzz/6304245 to your computer and use it in GitHub Desktop.
Used for testing how the error propagation is handled in the internal streams
var godot = require('godot');
var server = godot.createServer({
type: 'tcp',
reactors: [
godot.reactor()
.console()
.map(function (data, callback) {
callback(new Error('WHOOPS GAIZ'));
}, { passThrough: true })
.console()
]
});
server.on('error', function (err) {
console.error('godot server error: ' + err);
});
var client = godot.createClient({
type: 'tcp',
producers: [
godot.producer({
host: '127.0.0.1',
service: 'godot/test',
state: 'test',
metric: 1,
ttl: 1000 * 5
})
]
});
server.listen(3000, function () {
client.connect(3000);
client.on('error', function (err) {
console.error('godot client error: ' + err);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment