Closed jasnell closed 2 years ago
See https://wicg.github.io/scheduling-apis/#sec-scheduler. The idea is that scheduler.postTask()
is that API. The other thing we want to do is introduce AbortSignal.timeout()
: https://github.com/whatwg/dom/issues/951.
Let's dupe into https://github.com/whatwg/html/issues/617 and continue the discussion there.
In Node.js 15.x, we introduced the concept of awaitable timers... variants of
setTimeout()
andsetInterval()
that return promises. For instance:https://nodejs.org/dist/latest-v17.x/docs/api/timers.html#timers-promises-api
https://nodejs.org/dist/latest-v17.x/docs/api/timers.html#timerspromisessetintervaldelay-value-options
These have proven to be very useful for a number of cases and I believe it's worthwhile to at least discuss whether they should be standardized in some variation within the HTML spec.