diff --git a/index.js b/index.js index 5166550..cf78736 100644 --- a/index.js +++ b/index.js @@ -62,14 +62,16 @@ }); module.exports.runLoopOnce = function(){ - process._tickDomainCallback(); + var tick = process.domain + ? process._tickDomainCallback + : process._tickCallback; + tick(); binding.run(); }; module.exports.loopWhile = function(pred){ while(pred()){ - process._tickDomainCallback(); - if(pred()) binding.run(); + module.exports.runLoopOnce(); } };