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

@appden 

> It seems fitting that only the creator of the request should have the power to cancel it.

which is exactly what everyone proposed here. You create the promise and still you **optionally** define its cancelability.

In my code/examples it's me defining it, in fetch case would be the vendor defining it. Call it abort, if you prefer, the concept is that since you are the creator and you have the rights to decide abortability, why would not give the ability to expose this decision?

If you don't want to expose such cancelability, but you define it for your own code, you can wrap it in a non cancelable Promise and pass around that one instead.


> Obviously, calling fetch('/some/url') would not have it, but in the simplest cases you don't typically need to abort a request anyways.

that's usually what libraries are for, not core APIs. Latter should be as easy as possible and yet provide coverage for all cases too ... and here is where this problem was raised and yet not a concrete solution.

Anyway, the TL;DR of this thread is indeed the following:

> a promise represents a end result 

Which is a footgun for anything asynchronous network related. Again, for some reason fetch cannot change its returned type which is already specified as Promise, so here somebody tried to put a line between abstracts and real-world needs, proposing solutions.

It apparently ended up that behind the scene, the core API is indeed capable of aborting a Promise ... of course it's needed, of course abstract and pattern purism is less important than concrete needs ...

However, I believe this thread could be simply closed because the solution is probably been discussed elsewhere since there's no progress whatsoever, and every single time any of us replies is not adding anything new to this discussion, or clarifying anything else, to anyone involved, since everyone understands everything already said, it's just a matter of applied or avoided-at-all-costs pragmatism.

I'm indeed, for everyone happiness, officially done here, unless somebody calls me in explicitly.

Best Regards ... and let's hope it won't end up worst than this:

![screenshot from 2015-05-15 08-30-39](https://cloud.githubusercontent.com/assets/85749/7648600/bc5f4fa4-fadc-11e4-9d8b-3cf2d2d74632.png)


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

Received on Friday, 15 May 2015 07:34:58 UTC