Microtask scheduling
Kris Siegel
krissiegel at gmail.com
Mon Jun 26 06:51:47 UTC 2017
This seems more like a platform-level feature versus something that needs
to be part of the ECMAScript standard. Also, keep in mind it's rarely a
good idea to explicitly call nextTick() in node as it executes the code
immediately after the current code is finished and before the next,
scheduled code (this can cause issues with processing I/O if you're doing
it too frequently).
In a browser you can sorta emulate similar behavior through IE's
setImmediate(), using postMessage() or even the requestAnimationFrame().
Granted none of those are exactly like nextTick() and I wouldn't mind
seeing something like setImmediate() become more of a standard but this
isn't for the ECMAScript group.
On Wed, Jun 21, 2017 at 2:10 PM, Isiah Meadows <isiahmeadows at gmail.com>
wrote:
> It's a relatively low-level operation, but in performance-sensitive
> async code and polyfills, there's still a strong need for raw
> microtask scheduling, at a much lower level than promises. In
> particular, there's two very frequently used modules providing a
> wrapper for this specific thing:
>
> 1. next-tick: A browser polyfill for Node's `process.nextTick`, with
> over 2M downloads last month and 88 direct dependents.
> 2. asap: A microtask scheduler that avoids blocking Node's I/O loop,
> with over 7M downloads last month and 88 direct dependents.
>
> In addition, several libraries like Bluebird have to implement their
> own wrappers to gain similar functionality without assuming another
> dependency.
>
> Any chance something like Node's `process.nextTick` could be added,
> maybe something like `Promise.schedule(func, thisArg, ...args)`?
>
> -----
>
> Isiah Meadows
> me at isiahmeadows.com
>
> Looking for web consulting? Or a new website?
> Send me an email and we can get started.
> www.isiahmeadows.com
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170625/61392b0f/attachment.html>
More information about the es-discuss
mailing list