Handle callbacks within a domain

This commit is contained in:
Luke Petre
2015-10-06 15:26:09 +01:00
parent 6a789754ea
commit 7faeada0f0

View File

@ -140,6 +140,10 @@ Transport.prototype.request = function (params, cb) {
// determine the response based on the presense of a callback
if (typeof cb === 'function') {
// handle callbacks within a domain
if (process.domain) {
cb = process.domain.bind(cb);
}
ret = {
abort: abortRequest
};