I am no expert on this, but I've heard multiple times from different sources that process.nextTick(..) in node.js is not suitable for micro-task scheduling because it doesn't first flush the event loop queue, so it can create starvation (which micro-tasks are meant to avoid, at least with promises). I've heard specifically such assertions in relation to promises, and the conclusion was instead to use setTimeout(..0) or setImmediate(..).
Just figuring someone should research this and get an official answer once and for all. :)
Actually micro-tasks are specifically meant to cause starvation... process.nextTick is the correct choice. Curious where you heard this so I can go correct them :)
Regarding: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1171
I am no expert on this, but I've heard multiple times from different sources that
process.nextTick(..)
in node.js is not suitable for micro-task scheduling because it doesn't first flush the event loop queue, so it can create starvation (which micro-tasks are meant to avoid, at least with promises). I've heard specifically such assertions in relation to promises, and the conclusion was instead to usesetTimeout(..0)
orsetImmediate(..)
.Just figuring someone should research this and get an official answer once and for all. :)