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

@mariusGundersen

> I assume the finally callback doesn't take any arguments?

Correct. Same as with sync code.

> This can be solved by having the promise that .cancel is called on ignore any result given to it. So waitingPromise in your example would mark itself as CANCELLED so that even if the promise it is waiting for is resolved, itself wont resolve.

Unless I'm understanding the spec wrong, I think the problem is that `waitingPromise` *has* already resolved, but it's resolved with a promise, so `waitingPromise` hasn't yet settled. Allowing a promise that has resolved but not settled to cancel could solve this, but that might have a greater impact elsewhere.

> BTW, this would work pretty well with async/await:

This requires async functions to return cancellable promises.

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

Received on Thursday, 16 April 2015 14:49:20 UTC