Skip to content

Need to communicate using postMessage with ServiceWorkers #34

@arcturus

Description

@arcturus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions