cancellation-use-cases icon indicating copy to clipboard operation
cancellation-use-cases copied to clipboard

Linked abort signals task list

Open benjamingr opened this issue 5 years ago • 1 comments

Copied from https://github.com/whatwg/dom/issues/920

  • [x] Create explainer skeleton. https://github.com/benjamingr/cancellation-use-cases/tree/main/cancellation
  • [ ] Add example use cases, including simple code samples so that people get the idea, plus a sketch of more complicated real-world situations.
  • [ ] Add description of the problem clearly as illustrated in the use cases.
  • [ ] Add comparison with other ecosystems and languages.
  • [ ] Add discussion of how people solve this today, and what the drawbacks are.
  • [ ] Add comparison between different APIs and their pros/cons and how they would look with the above use cases. Namely: new AbortController(...signals), new AbortSignal(...signals), AbortSignal.race(signal, otherSignal), signal.follow(otherSignal).
  • [ ] Add discussion of alternative approaches that would enable implementing this in userland (weak event handlers and dispose on the signal that removes the listener).
  • [ ] Set up meeting to discuss the above and invite interested parties to solicit feedback.

Also big thanks to @domenic for this list, roughly taken from here.

benjamingr avatar Dec 23 '20 10:12 benjamingr

Intuitively - when working on this there are several pros and cons:

Pros:

  • The use cases here is very compelling and reasonable.
  • The problem being worked on is real.
  • I am genuinely not sure what the better API is so I am approaching this with a "clean slate". I feel like other people who have expressed interest in this are similarly not sure about the solution - so I'm sure a lot of learning will happen.

Cons:

  • I would have preferred third-state cancellation which we will never be able to have since it was shot down by TC39.
  • This touches an area a lot of people have strong opinions about.
  • There is a reasonable chance this will not result in a new API being added since it requires the solution we come up with providing browsers with enough value for them to prioritize adding it.

benjamingr avatar Dec 23 '20 10:12 benjamingr