Last active
January 2, 2016 13:19
-
-
Save sam-github/8309330 to your computer and use it in GitHub Desktop.
This file contains 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 Emitter = require('events').EventEmitter; | |
var domain = require('domain'); | |
d = domain.create(); | |
d.enter() | |
d.on('error', function(er) { | |
d.exit(); | |
ee.emit('report', function() { | |
console.log('reported, now throw'); | |
setImmediate(function() { | |
throw er; | |
}); | |
}) | |
}); | |
var ee = new Emitter; // should be in domain, d? | |
ee.on('report', function(cb) { | |
console.log('in report'); | |
cb(); | |
}); | |
process.nextTick(function() { | |
throw Error('BANG'); | |
}); |
This file contains 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 Emitter = require('events').EventEmitter; | |
var domain = require('domain'); | |
d = domain.create(); | |
d.enter() | |
d.on('error', function(er) { | |
d.exit(); | |
ee.emit('report', function() { | |
console.log('reported, now throw'); | |
throw er; | |
}) | |
}); | |
var ee = new Emitter; // should be in domain, d? | |
ee.on('report', function(cb) { | |
console.log('in report'); | |
cb(); | |
}); | |
process.nextTick(function() { | |
throw Error('BANG'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment