Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace recursive process.nextTick usage with setImmediate #4

Open
itpmngt opened this issue Jan 5, 2014 · 0 comments
Open

Replace recursive process.nextTick usage with setImmediate #4

itpmngt opened this issue Jan 5, 2014 · 0 comments

Comments

@itpmngt
Copy link

itpmngt commented Jan 5, 2014

As per http://blog.nodejs.org/2013/03/11/node-v0-10-0-stable/

You've got a recursive process.nextTick happening in line-by-line - and we're seeing this crash node occasionally with:

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next .
version of node. Please use setImmediate for recursive deferral.
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral..........
RangeError: Maximum call stack size exceeded

More info here:
http://blog.peakji.com/node-js-process-nexttick-and-setimmediate/

And because setImmediate is not available in previous 'node' would be good to have a fallback like:

if (typeof setImmediate == 'undefined') { var setImmediate = process.nextTick; }

Great plugin - Thank You

Osterjour referenced this issue in Osterjour/line-by-line Feb 25, 2014
The setImmediate (#4) fixed also a huge problem with loosing some lines if you try to pause and resume after every line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant