Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestions #128

Open
publicocean0 opened this issue May 26, 2016 · 2 comments
Open

suggestions #128

publicocean0 opened this issue May 26, 2016 · 2 comments

Comments

@publicocean0
Copy link

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.

@jakearchibald
Copy link
Collaborator

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

On Thu, 26 May 2016, 09:12 publicocean0, [email protected] 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

@publicocean0
Copy link
Author

publicocean0 commented May 27, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants