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

@jhusain 

> Can you clarify what you mean by producer?

Since fetch itself is an opaque utility, it's not the "producer" I mean. It's a tool the "producer" uses.

By "producer" I really mean the code which actually makes the initial call to the `fetch(..)` call (or whatever API)... that may very well be the main consumer of the response. If it's the only consumer, it's no big deal.

But this "producer" code also may very well send that promise to other parts of the system, either directly, or indirectly as a sub-promise chained off the main returned promise. It's these other parts of the system which would have reference (refcount) that the main "producer" would not be able to undo if it later needed to trump the system and say "hey, gotta abort."

I regularly model my systems where I take a single promise from some util and pass it around to various observers in the system as a token to let them know "it's ok to move on with what you were doing". But I also have cases where the initial "producer" of that promise needs to take over. It's much harder to design such a system if I also need all those observer parts of the system to expose some "heyStopListeningToThatThingISentYouEarlier(..)` API.

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

Received on Monday, 30 March 2015 15:53:08 UTC