Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use setImmediate when available instead of process.nextTick #6

Open
wants to merge 1 commit into from

2 participants

@wibblymat

process.nextTick preempts IO, so in almost all cases setImmediate is preferred.

@wibblymat wibblymat Use setImmediate when available instead of process.nextTick
process.nextTick preempts IO, so in almost all cases setImmediate is preferred.
7529474
@jportela

This looks OK to me. Let me know how can I help to get this pull request merged in a new version of chainsaw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 16, 2013
  1. @wibblymat

    Use setImmediate when available instead of process.nextTick

    wibblymat authored
    process.nextTick preempts IO, so in almost all cases setImmediate is preferred.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  index.js
View
3  index.js
@@ -1,5 +1,6 @@
var traverse = require('traverse');
var EventEmitter = require('events').EventEmitter;
+var immediate = global.setImmediate || process.nextTick;
module.exports = Chainsaw;
function Chainsaw (builder) {
@@ -38,7 +39,7 @@ Chainsaw.saw = function (builder, handlers) {
}
});
- process.nextTick(function () {
+ immediate(function () {
saw.emit('begin');
saw.next();
});
Something went wrong with that request. Please try again.