Re: [w3c/ServiceWorker] A way to immediately unregister a service worker (#614)

Attempting to move the F2F `unregister/terminate/unsafelyDispose` discussion here, from:
https://github.com/w3c/ServiceWorker/issues/1303#issuecomment-432967494
https://github.com/w3c/ServiceWorker/issues/1303#issuecomment-434513827

I'd like to suggest adding options to unregister() that allow immediately stopping any new events being sent to the service worker (even for already opened clients) and then terminating all associated workers (and their associated tasks) with some time guarantee. For instance:

```JavaScript
// Immediately stop sending events to the service worker, all
// workers will be completely gone within 10 seconds.
navigator.serviceWorker.unregister({
  unclaim: true,
  terminateDeadline: 10000
});
```

Another option would be to create a new method `unclaim()`, which is like `unregister`, but immediate, also with a `terminateDeadline` option.

One potential edge case is, what happens if you call `unregister()` with no options, but then later want the immediately `unclaim` behavior?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/614#issuecomment-434755128

Received on Wednesday, 31 October 2018 16:38:33 UTC