On May 27, 2012, at 6:30 AM, Tim Caswell wrote:

> There are already many ways to starve/block the event loop.
> 
> You could have an infinite loop
> 
> while (true) {}
> 
> Or a recursive loop that blocks till the stack overflows
> 
> function a() {
>   a();
> }
> a();
> 
> Now these new semantics would add another way to do the recursive loop, 
> except this time the trampoline is built in and the stack doesn't overflow.
> 
> function a() {
>   process.nextTick(a);
> }
> a();
> 
> If we're worried about changing the name to match the meaning and we're 
> worried about breaking existing code (I know I have some that accidentally 
> depends on the non-blocking nature), we could add a new function 
> process.afterTick that does the new semantics and deprecate process.nextTick.
> 
> Then no code breaks and we eventually get the right behavior with the right 
> name.


This needs a different method name, if not, the sky is going to fall on our 
heads.

And the proper name IMO would be *this*Tick not *next*Tick :-P

And perhaps it should be internal, not part of the public API: _thisTick(). But 
that depends: exactly *where* have you seen the problem you mention, @izs?
-- 
Jorge.

Reply via email to