Ok, I think I'm thinking about process.nextTick as it was in node <0.10,
where, if I'm not mistaken
function f() {
process.nextTick(f)
}
f()
would loop infinitely, whereas an immediate recursive call throws
RangeError.
I tried running that in v0.10 and got RangeError. However,
function f() {
setImmediate(f)
}
f()
puts the function in "background" and makes node process consume 100% CPU.
What happens there?
On Friday, November 8, 2013 5:20:21 PM UTC-5, Rick Waldron wrote:
>
>
>
>
> On Fri, Nov 8, 2013 at 3:57 PM, Ilya Shaisultanov
> <[email protected]<javascript:>
> > wrote:
>
>> Pardon for resurrecting such old thread but I have a question about
>> process.nextTick: why/how does it eliminate the current stack? What happens
>> behind the scenes?
>>
>
> It doesn't eliminate the current stack. The callback is "scheduled" and
> subsequently executed in the next execution turn.
>
> Rick
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.