Re: [ServiceWorker] Allow respondWith() to be called asynchronously or allow some way to cancel the response. (#836)

In #771 we agreed that it should be possible to call `waitUntil` asynchronously, but I think so far the plan was to still require `respondWith` to be called asynchronous. I personally think that your use case sounds pretty reasonable though. Of course allowing `respondWith` to be called asynchronously (but still only once, and only while there are still unresolved `waitUntil` promises) could potentially make things confusing for developers as figuring out where a fetch request is handled becomes a bit more complicated, but that's just what you choose for if you decide to have multiple fetch event handlers.

So I think that especially since we're already going to allow `waitUntil` to be called asynchronously we might as well also allow `respondWith` to be called asynchronously. I don't remember if there were any strong arguments against doing so, other than that it didn't seem particularly useful.

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

Received on Thursday, 18 February 2016 22:34:20 UTC