Handle callbacks within a domain
This commit is contained in:
@ -140,6 +140,10 @@ Transport.prototype.request = function (params, cb) {
|
|||||||
|
|
||||||
// determine the response based on the presense of a callback
|
// determine the response based on the presense of a callback
|
||||||
if (typeof cb === 'function') {
|
if (typeof cb === 'function') {
|
||||||
|
// handle callbacks within a domain
|
||||||
|
if (process.domain) {
|
||||||
|
cb = process.domain.bind(cb);
|
||||||
|
}
|
||||||
ret = {
|
ret = {
|
||||||
abort: abortRequest
|
abort: abortRequest
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user