[go: nahoru, domu]

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

allow service workers to created nested dedicated workers #1529

Open
wanderview opened this issue Aug 13, 2020 · 7 comments
Open

allow service workers to created nested dedicated workers #1529

wanderview opened this issue Aug 13, 2020 · 7 comments

Comments

@wanderview
Copy link
Member

I think we've discussed this before, but I cannot find the issue. It would be nice to allow service workers to created nested dedicated workers via new Worker(). This would allow the service worker to perform CPU intensive operations, like custom decoding, without potentially blocking the thread being used to process further FetchEvents.

chromeos/static-site-scaffold-modules#40 (comment) is an example of where this would be useful.

@jakearchibald
Copy link
Contributor

Yeah, I think workers are currently linked to a root document, so that needs to be changed to "document or service worker global", or something common between the two.

@wanderview
Copy link
Member Author

I think dedicated workers can be nested under shared workers right now?

@mfalken
Copy link
Member
mfalken commented Aug 27, 2020

Would the idea be that the dedicated worker lives as long as the service worker is running?

@wanderview
Copy link
Member Author

Correct. Its lifetime would be bound by the lifetime of its parent, just like when creating a dedicated worker in a window or iframe.

@tophf
Copy link
tophf commented Jun 10, 2021

FWIW, It would be useful for the new ManifestV3 browser extensions (currently implemented only in Chrome), which are built on service workers now so they've completely lost the ability to create workers in the background script.

Looks like whatwg/html#411

@cohenerickson
Copy link

I would love to see this become implemented into the service worker spec, I think it would be beneficial for highly computational fetch requests.

@ian97531
Copy link
ian97531 commented Oct 6, 2022

I created a similar issue over in WHATWG: whatwg/html#8362

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

6 participants