-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Comments
Corrected the issue (it's @halter73's code sample 😄 ) |
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 :) |
My bad I thought this was a web worker example not a service worker. |
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. |
Yes, this should be a web worker doc, not a service worker. I agree it doesn't make much sense talking about service workers. |
Fixed :) |
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
The text was updated successfully, but these errors were encountered: