- From: Scott Haseley <notifications@github.com>
- Date: Tue, 24 Sep 2019 15:51:00 -0700
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 24 September 2019 22:51:22 UTC
@kenchris @domenic > Yes, I strongly recommend replacing the `.cancel()` with an `AbortController`-based design. In fact I think the design could be changed to just return promises, moving other manipulation methods to a subclass of the `AbortController` (similar to our plans for `FetchController`). This would allow eliminating the `Task` class altogether, which IMO would be a big simplification for the platform, as right now `Task` occupies much of the same design space as `Promise`. Thanks for the suggestion. My fear is that by replacing useful, common scheduling abstractions like `Task` and `TaskQueue` with a strict controller/signal/promise design, that the ergonomics will suffer and we’ll make the API for a complex area even more complex. At the same time, being able to combine other signals with this API is powerful and we’re exploring alternate API shapes that support/use signals/controllers, and I’ve filed an [issue](https://github.com/WICG/main-thread-scheduling/issues/5) in the explainer repo to track this. One powerful use case outside of abort is changing priority, if we support that for other async APIs like `fetch()`. @domenic do you have a reference for `FetchController`? I couldn’t find a proposal. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/338#issuecomment-534778379
Received on Tuesday, 24 September 2019 22:51:22 UTC