+1k ^ 256 On Jun 2, 2012, at 11:29 AM, Bruno Jouhier wrote:
> Trying to be constructive (and apologies for the flame on applications). > Would the following be a reasonable way forwards: > > * deprecate nextTick. It is confusing and changing it may create difficulties > and add to the confusion. > * introduce a new API (name open) for a callback that will be called before > any I/O events gets dispatched > * introduce an onIdle or equivalent callback that will be called when the I/O > queue is empty. > * (optionally) introduce a setImmediate that will be interleave with I/O > events. > > Bruno > > On Saturday, June 2, 2012 10:03:28 AM UTC+2, stagas wrote: > 2012/6/2 Isaac Schlueter <i...@izs.me>: > > > > However, this program will (maybe) be affected: > > > > process.nextTick(function f () { > > process.nextTick(f) > > }) > > setTimeout(function () { > > console.log('bar') > > }, 100) > > > > Also, we can probably figure out a way to make it work such that it > > runs the first nextTick at the end of the current RTC, but subsequent > > ones at some point get deferred. As I said earlier in the thread, we > > haven't investigated it thoroughly. > > > > If we defer subsequent calls then it's the same thing, but without the > I/O window that causes bugs. I don't care if it's last or first. The > idea was scary because it was suggested that this would starve the > event loop and that it was OK to do that. It's black and white > different, and if you need that kind of behavior, then it's better to > use a new method for that.