What’s the current standards track / implementation thinking on this? With the momentum that’s come up behind Promises, it seems like something like this must have been added under the hood in Firefox and Chrome. (And, of course, Node/io.js are requiring it over process.nextTick()
“in the next version”.)
setImmediate(func)
We never got enough traction in the webperf group to standardize it. An old draft is at http://w3c.github.io/web-performance/specs/setImmediate/Overview.html but we never went beyond that. Look at the thread at https://lists.w3.org/Archives/Public/public-web-perf/2013Aug/0025.html .
What I don’t get is why nobody in those threads suggested treating an infinitely recursive setImmediate() loop the same way as browsers treat while(true){}
now: namely, letting it run for a few seconds (without throttling), then halting the thread’s execution while the user is prompted that the tab appears to be over-working (albeit not frozen), and asked if they want to kill it. This would discourage devs from abusing setImmediate where they should be using requestAnimationFrame or something throttled like setTimeout(0), while still allowing good-actors to use it uninhibited.
Is there somewhere I can suggest this be revisited? What’s involved in posting to es-discuss?