-
Notifications
You must be signed in to change notification settings - Fork 8
Description
While testing integration of ServiceWokers with threads.js as a mechanism to communicate with SW (see: https://github.com/arcturus/sww-render-cache).
We realized that, following the spec, the UA can kill a SW at any moment. Which mean that the broadcast communication channel won't respond to any message (as the server side in the SW has been already killed).
Following the spec, we also see that a SW can be wake up again if we send a postMessage to it, so the communication mechanism that we should have for SW should be postMessage to be sure that the SW will be alive when we perform the communication.
Another point to take into account is that with a postMessage we will relaunch the sw, so if there was already some metadata set up, needed for the communication, some how we will need to reuse it.