scheduler.yield() is an API for yielding control to the browser's event loop, which can be used to break up long tasks. Awaiting the promise returned by scheduler.yield() causes the current task to yield, continuing in a new browser task. This can be used to improve responsiveness issues caused by long tasks. Continuations are prioritized to mitigate performance problems of existing alternatives.
Explainer¹ (minimally containing user needs and example code):
こんにちは TAG-さん!
I'm requesting a TAG review of
scheduler.yield()
.scheduler.yield()
is an API for yielding control to the browser's event loop, which can be used to break up long tasks. Awaiting the promise returned byscheduler.yield()
causes the current task to yield, continuing in a new browser task. This can be used to improve responsiveness issues caused by long tasks. Continuations are prioritized to mitigate performance problems of existing alternatives.Further details:
You should also know that...
scheduler.postTask()
, previously reviewed here