WICG/background-sync

suggestions

publicocean0 opened this issue · 2 comments

Websocket is asynchronous object as Push notification Object. So it is not necessary service worker stays alive along as it is not necessary now for PushManagegment.
Same problem another developer could tell you about event sent messages.
In general we have now powerfull asynchronous ways but we can 't use them because service worker offer just Push Manager that follows a model completely not related to new http abilities.
Shared worker has the life of the shared domain navigation, but if i leave a specific domain i could desire to receive a notification to go again in this site. So shared worker don't satisfy all the possible needs.
A web worker has the life of the page, so it is not for this use.
In addition websocket is not a serializable object , so i can't save it in the cache for restoring it in a following request.

I'm struggling to figure this out. Could you reword the problem?

On Thu, 26 May 2016, 09:12 publicocean0, notifications@github.com wrote:

Websocket is asynchronous object as Push notification Object. So it is not
necessary service worker stays alive along as it is not necessary now for
PushManagegment.
Same problem another developer could tell you about event sent messages.
In general we have now powerfull asynchronous ways but we can 't use them
because service worker offer just Push Manager that follows a model
completely not related to new http abilities.
Shared worker has the life of the shared domain navigation, but if i leave
a specific domain i could desire to receive a notification to go again in
this site. So shared worker don't satisfy all the possible needs.
A web worker has the life of the page, so it is not for this use.
In addition websocket is not a serializable object , so i can't save it in
the cache for restoring it in a following request.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#128

I have a websocket. I tried to realize a Service worker for proxy the clients connection so the browser doesnt make a new connection for every page reload. In addition i want the connection stay alive during the navigation so if the websocket sent a event , i can notify the event to the user.
Now it is impossible to do it.
Using shared Worker now at maximum you can proxy a connection until user has a page opened in that domain. Considering that it is the minimum to do , because else

  1. ws lose perfomance
  2. you can miss the business logic state for every page reload (inter time between reloading phase)
    But if i go in another domain , i can t notify the user. HTML5 added async events generated by http protocol , but service worker doesnt handle them.
    Problem in service worker:
  3. there is no onstart/onstop event for managing in intelligent way the connection.
  4. it is missing a general abstract concept for waking up the service on "alive objects" as websocket,server sent messages. On message event it might wake up the service as now it does it for pushmanager. Pushmanager use a protocol that dont add anything to the actual http abilities. I dont understand for what reason to add another protocol. I might registerAliveObject(ws) in serviceWorkerScope and the browser manage the wakeing up on message. Conceptually it is more general and permits to do all what a developer can imagine. Service worker has short life as now.