I've run into something with domains that doesn't seem ideal. Take the 
following little program (running in v0.8.3):

var domain = require('domain');
var http = require('http');

var d = domain.create();
d.on('error', function(err) {
console.log('error in domain: ', err.stack);
});

d.run(function() {
http.get(process.argv[2], function(res) {
// this callback IS bound to the domain
// if I throw an error here, the domain will catch it
if (res.statusCode === 404) {
throw new Error('not found');
}
 res.on('end', function() {
// this callback, however, IS NOT bound to the domain
// this seems like unintended behavior
throw new Error('yo');
});
});
});

In this case, the ClientResponse object doesn't appear to be bound to the 
domain. Is that intended? Is there something I'm missing?

Thanks!
Will Conant

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to