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

@annevk not if you have multiple fetch event listeners. I agree that in most cases it should be possible for a fetch event listener to synchronously decide whether to call respondWith (and claim the event) or not call it (and let other event listeners have a go at it), but it might not in all cases.
But thinking about it more, I don't actually think that allowing respondWith to be called asynchronously would actually really solve the use case presented here. Calling respondWith asynchronously would just introduce a race between the possibly multiple fetch event listeners and whichever ends up calling it first will end up handling the fetch (rather than the described behavior where other event listeners should only get a chance when the first listener asynchronously decides not to handle the fetch...).

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

Received on Friday, 19 February 2016 17:55:43 UTC