- From: Takeshi Yoshino <notifications@github.com>
- Date: Sun, 15 Mar 2015 22:07:08 -0700
- To: whatwg/streams <streams@noreply.github.com>
Received on Monday, 16 March 2015 06:04:17 UTC
OK, let me summarize the cancellable promise approach. ``` const fetchPromise = fetch(request); ``` - [Plan A] `fetchPromise.cancel()` works only while the `Response` is not yet available - returns **true** if the `fetchPromise` is not yet fulfilled - returns **false** if the `fetchPromise` is already fulfilled - to terminate the fetch algorithm, we need to call some method on the `Response` (fulfillment value of `fetchPromise`) that terminates HTTP body receiving - [Plan B] `fetchPromise.cancel()` works for terminating the fetch algorithm at any stage - return type of fetchPromise.cancel() is void. - fetchPromise may be already fulfilled and there's already a microtask to run the fulfillment callback. - even in such situation, `fetchPromise.cancel()` can be used for stopping HTTP body receiving Is your idea described well in [Plan B]? --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/297#issuecomment-81418080
Received on Monday, 16 March 2015 06:04:17 UTC