Re: [ServiceWorker] Cancelling HTTP fetch (#592)

Coming back to this a few days after the discussion in https://github.com/whatwg/streams/issues/297#issuecomment-81395077 it seems the key question to me is whether we want to require: (a) two separate cancellation mechanisms, one for before headers arrive and one after; or (b) a single cancellation mechanism that works for both.

Any promise-cancellation--based approach seems to lean toward (a). You use promise cancellation for before headers arrive. After headers arrive, the promise is already settled, and you can't do anything to affect it. So after headers arrive you use stream cancellation.

Approaches like @tyoshino's controller, or maybe an approach like `req.abort()` (note: would not work with `RequestInit` version of `fetch()`), seem to allow more flexibility to achieve (b).

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/592#issuecomment-83427299

Received on Thursday, 19 March 2015 08:57:03 UTC