rxjs icon indicating copy to clipboard operation
rxjs copied to clipboard

Watch WICG Scheduling API proposal

Open benlesh opened this issue 4 years ago • 3 comments

The proposal can be found here:

https://github.com/WICG/scheduling-apis

I think this may be a viable future for replacing our schedulers with something vastly more useful and flexible, and (even better) integrated into the platform.

There are so many interesting bits here. In particular I think the TaskController is of particular interest to us, as it has a signal property that can mirror the behavior of AbortSignal, and it has the ability to setPriority for all posted tasks. On such priority includes immediate, which seems to ensure it will happen before everything else, which might make a reasonable replacement for QueueScheduler.

This proposal has already shipped behind a flag in Chrome. No idea (at the moment, I'll need to read more) if it will have an analog of any sort in Node.

Additional reading on the API design is here:

https://docs.google.com/document/d/1xU7HyNsEsbXhTgt0ZnXDbeSXm5-m5FzkLJAT6LTizEI/edit#

cc @shaseley (who I think is the primary author of the proposal)

benlesh avatar Jul 15 '21 17:07 benlesh

Yep, I'm driving this project. A little more info:

  • That doc you linked was the first iteration of postTask(), so it's now a bit outdated. The most up-to-date info for scheduler.postTask() is the explainer (and optionally spec).
  • We're aiming to ship postTask() soon, hopefully in Chrome M94
  • postTask() is the first thing we want to ship, but have plans to do more in the broader scheduling space
  • There was some preliminary discussion on plans for adding this to Node here

As I mentioned here, we'd be interested to hear more about your use cases. We do want the scheduler to be something we evolve over time to cover more use cases. Maybe it would make sense to have a higher-bandwidth conversation? I'm always interested to hear about how frameworks are thinking about scheduling.

shaseley avatar Jul 15 '21 19:07 shaseley

more here https://wicg.github.io/scheduling-apis/#sec-task-controller

benlesh avatar Feb 11 '22 16:02 benlesh

Can you add a banner for the proposal to the docs? This needs to get upvoted, it's so cool

vdawg-git avatar Oct 23 '24 22:10 vdawg-git