w3c / requestidlecallback

Cooperative Scheduling of Background Tasks
https://w3c.github.io/requestidlecallback/
Other
50 stars 19 forks source link

Relying on an event loop might restart an idle period for each task #96

Closed noamr closed 2 years ago

noamr commented 2 years ago

Since starting an idle period is called from processing a task on the main event loop, and every idle task is processed on that same event loop, it's implied from the spec that the idle tasks themselves would start a new idle period, resetting the deadline and allowing pending tasks to run.

This is of course not the intention, as the prose in the spec mentions that there could be only one idle period at the same time.