Re: [ServiceWorker] Returning a FetchPromise from fetch() (#625)

@otakustay Yeah, I'm not sure how to address that scenario either, with the `FetchPromise` approach.  Darn.

I guess looking seriously into token approaches is the way to go; that separates the capability from the class, so you don't have to do gymnastics to keep the type correct and the cancellation chain going.  

We'll need to think about ergonomics, though; particularly, how to offer the same "chain rejections upward" scenarios we talked about previously.  The rejection-chaining worked well when every chained `FetchPromise` was refcounted by its parent, and if all the current children got cancelled the parent got cancelled. How can we reproduce this with a cancellation token?  It would probably be annoying to have to create new cancellation tokens for each chained promise.  Maybe you really do only get the ability to abort the original "capable of being cancelled" action, and it's up to you to manage consumers wanting to to cancel?  This seems unfortunate, and I'd like to think on it.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/625#issuecomment-76624734

Received on Sunday, 1 March 2015 19:12:20 UTC