Re: [fetch] Aborting a fetch (#27)

> If all consumers stop listening for the outcome

The problem I see with this implicit GC-directed version of cancelation is that the producer very quickly stops being in control of who is observing the outcome of the task. If you make a `fetch(..)` call, and pass its promise/Task/whatever return value around to multiple observers, and then something critical happens and you (the producer) decide you need to cancel the `fetch(..)` (abort an upload b/c user goes offline, etc), you can't, because you can't reach into all those possible places where observers attached and get all of them to `cancel(..)` or `ignore(..)` or even just unset themselves for GC purposes.

Also, GC is not guaranteed to happen as soon as all refs are unset. If you want to abort a `fetch(..)` right now, and you unset all observers, the engine may not GC all those for seconds or more, which means the abort may very well not happen immediately.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/27#issuecomment-87721095

Received on Monday, 30 March 2015 15:21:58 UTC