BlazorWorker icon indicating copy to clipboard operation
BlazorWorker copied to clipboard

Any plans to use SharedWorker?

Open grahamglover opened this issue 4 years ago • 2 comments

Thanks for this library. I noticed in the source it is using Worker.js and interested if you have plans to use the SharedWorker.js instead?

Not 100% knowing what i'm talking about, but inspired by this library https://github.com/neomjs/neo it would be very useful to be able to popout a blazor component into its own browser tab - and port to existing worker seamlessly. Completely off the radar or not relevant to objectives of your library?

grahamglover avatar Feb 04 '21 23:02 grahamglover

Hello. Thank you for your feedback.

No plans for shared worker api. It could be interesting I guess, but probably quite a different api compared to the one already implemented at least in blazorworker.backgroundservice, and browser support seems a bit sketchy.

I think that multi tab apps would be quite an unusual usecase. Also bear in mind that blazorworker, as it is today, is just a dotnet worker that can be used by Blazor. You cannot run the actual Blazor framework inside it today, just "normal" dotnet code. So you would have to reload/reinitialize the Blazor framework in a new tab. Indeed, you would not have to reinitialize the worker, and I guess a shared state could have some advantages, if you would close one of the tabs the workers could "live on"... Still sounds like an exotic use case.

My priorities for this library today are foremost a robust jsinterop support and a more performant message layer (maybe shared memory) and indexDb support for the core. And for the service abstraction I'd like to see more options for serialization and native streaming.

Tewr avatar Feb 05 '21 21:02 Tewr

Thanks for looking into it..I look forward to the roadmap!

graham83 avatar Feb 06 '21 10:02 graham83