Bug 22723

Summary: Implement nested Workers
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Enhancement CC: alonzakai, awm16899, bugmail, cdumez, dimich, dpaddock, d-r, jam, jarbon, jespertheend, jianli, jwbecher, karlcow, li.yin, mike, p-hespinoza, tobiasuhlig78, webkit-bug-importer, wycats, zcorpan
Priority: P4 Keywords: BrowserCompat, InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=158605
https://bugs.webkit.org/show_bug.cgi?id=255402
Bug Depends on: 25212, 25215, 25255, 25270, 25273, 255458    
Bug Blocks:    

Alexey Proskuryakov
Reported 2008-12-07 03:27:30 PST
It should be possible to create new Workers from Workers. The main low-level functionality that is still missing is an ability to load resources from Workers, same as in XMLhttpRequest and importScripts().
Attachments
Alexey Proskuryakov
Comment 1 2008-12-07 03:59:22 PST
Alexey Proskuryakov
Comment 2 2009-04-14 02:25:32 PDT
*** Bug 25152 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 3 2009-05-07 03:30:22 PDT
Assigning to Jian Li because of all the work done in blocking bugs.
Alexey Proskuryakov
Comment 4 2009-05-07 03:34:38 PDT
Sorry for asking this question relatively late in the game, but what are the use cases for nested workers? Do they warrant increased complexity in the existing and future (e.g. Web Inspector) code at this point? Creating workers from workers doesn't seem to be a dangerous feature, and it seems potentially useful, but it is not clear to me if it's useful enough to add yet, without feedback from web application authors who use workers.
Jian Li
Comment 5 2009-05-07 13:18:58 PDT
I think they're quite useful in developing a large web application. For example, an online email application can start a worker to fetch emails and store them in the local storage on the background. This worker can start a couple nested workers such that some actions can be done in parallel, like using XHR to send emails and receive emails. With nested worker support, it will become easier to write such big applications. If you need more information on this. Please ping me.
Dmitry Titov
Comment 6 2009-06-24 14:05:18 PDT
*** Bug 24016 has been marked as a duplicate of this bug. ***
John Abd-El-Malek
Comment 7 2009-07-07 15:24:29 PDT
Note: Firefox 3.5 has launched with support for this. Over lunch today, I chatted with Maciej about this and he supported the view that we should be at feature parity to avoid developer confusion.
Li Yin
Comment 8 2012-05-13 05:12:21 PDT
Does chromium have a plan to do that? Where can find detailed information? Thanks in advance.
Dmitry Titov
Comment 9 2012-05-14 13:52:22 PDT
I don't know about current plans but usually it was a question if there is enough real world need to justify the work... The work can be non-trivial, some part include loading refactoring (currently delegated to the parent, assuming it's a Page) and perhaps things like DevTools integration... In the past, the folks involved found more pressing needs to work on, that's it. Theoretically, it's a nice feature and it's in the spec :-)
Yehuda Katz
Comment 10 2013-01-25 17:41:04 PST
I am working on a library to support communication with sandboxed code that is agnostic to the specific sandboxing mechanism used. See https://github.com/tildeio/oasis.js Support for nested contexts is important for this library (and the use-cases that are driving it).
Alon Zakai
Comment 11 2014-06-24 10:43:55 PDT
I think this feature would be great to have. The use case I have right now is I'm taking a large application and moving it to run in a worker, so it's more responsive and never stalls the main thread. The application happens to use workers, so basically I need to be able to create workers from the worker I move the application to, for it to run. The current situation was a surprise to me: Nested workers are in the spec, are mentioned on html5rocks as working ( http://www.html5rocks.com/en/tutorials/workers/basics/#toc-enviornment-subworkers ), but in practice seem to only work in firefox at the moment :(
Alon Zakai
Comment 12 2014-07-14 12:37:10 PDT
Correction to my last statement, they work in Internet Explorer as well.
Chris Dumez
Comment 13 2016-06-09 22:15:22 PDT
*** Bug 158605 has been marked as a duplicate of this bug. ***
Simon Pieters (:zcorpan)
Comment 14 2019-05-08 12:38:43 PDT
A wpt test for this: https://wpt.fyi/results/workers/semantics/multiple-workers/003.html This test is currently marked [ Skip ] in WebKit TestExpectations.
Tobias Uhlig
Comment 15 2021-04-27 12:53:32 PDT
We could use this feature for the neo.mjs UI framework project to spawn the data worker from inside the app worker. Created a discussion here: https://github.com/neomjs/neo/discussions/1881 Ideally would be support for spawning a "normal" worker from within a SharedWorker as well. Is there already a ticket for this one? Spawning SharedWorkers from inside SharedWorkers is not needed for my context. Best regards, Tobias
Jesper van den Ende
Comment 16 2021-06-02 01:07:43 PDT
I have moved a library I'm using to a Worker, but the library itself creates another worker. Now my site works in all browsers except Safari :(
Chris Dumez
Comment 17 2022-09-14 19:22:23 PDT
*** Bug 245182 has been marked as a duplicate of this bug. ***
Chris Dumez
Comment 18 2022-09-14 19:22:42 PDT
EWS
Comment 19 2022-09-17 17:31:28 PDT
Committed 254597@main (48880e342359): <https://commits.webkit.org/254597@main> Reviewed commits have been landed. Closing PR #4349 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.