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

Add Web Worker doc/example for SignalR #11921

Open
Tracked by #23357
bradygaster opened this issue Apr 10, 2019 · 6 comments
Open
Tracked by #23357

Add Web Worker doc/example for SignalR #11921

bradygaster opened this issue Apr 10, 2019 · 6 comments

Comments

@bradygaster
Copy link
Member

bradygaster commented Apr 10, 2019

If we feel the browser service worker scenario warrants an entire doc article as requested via this issue, use @halter73's code samples below to source an article on the topic.

https://github.com/aspnet/AspNetCore/blob/9158039c9515e46d39c90f462ae91827769889c4/src/SignalR/samples/SignalRSamples/wwwroot/worker.html

https://github.com/aspnet/AspNetCore/blob/9158039c9515e46d39c90f462ae91827769889c4/src/SignalR/samples/SignalRSamples/wwwroot/worker.js

@davidfowl
Copy link
Member

Corrected the issue (it's @halter73's code sample 😄 )

@analogrelay
Copy link
Contributor

We should make sure to call out the limitations of using SignalR in a service worker. Because workers are spun up in response to an event and then shut down, you can’t leave a connection open throughout the life of the worker.

Most importantly, if you want the service worker to sit in the background waiting for the server to send it messages and then forward that data on to open Pages, it’s not trivial. This going to take some experimentation and exploration to get right :)

@davidfowl
Copy link
Member

My bad I thought this was a web worker example not a service worker.

@analogrelay
Copy link
Contributor

A web worker makes way more sense to me. Is that what was intended? Service workers aren't background services that can maintain a persistent connection.

@davidfowl
Copy link
Member

Yes, this should be a web worker doc, not a service worker. I agree it doesn't make much sense talking about service workers.

@analogrelay analogrelay changed the title Add Service Worker doc/example for SignalR Add Web Worker doc/example for SignalR Apr 10, 2019
@analogrelay
Copy link
Contributor

Fixed :)

@Rick-Anderson Rick-Anderson added this to the Backlog milestone Apr 10, 2019
@Rick-Anderson Rick-Anderson removed the PU label May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants