Bug 22723
Summary: | Implement nested Workers | ||
---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> |
Component: | DOM | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
<rdar://problem/6425810>
Alexey Proskuryakov
*** Bug 25152 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Assigning to Jian Li because of all the work done in blocking bugs.
Alexey Proskuryakov
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
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
*** Bug 24016 has been marked as a duplicate of this bug. ***
John Abd-El-Malek
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
Does chromium have a plan to do that?
Where can find detailed information?
Thanks in advance.
Dmitry Titov
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
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
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
Correction to my last statement, they work in Internet Explorer as well.
Chris Dumez
*** Bug 158605 has been marked as a duplicate of this bug. ***
Simon Pieters (:zcorpan)
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
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
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
*** Bug 245182 has been marked as a duplicate of this bug. ***
Chris Dumez
https://github.com/WebKit/WebKit/pull/4349
EWS
Committed 254597@main (48880e342359): <https://commits.webkit.org/254597@main>
Reviewed commits have been landed. Closing PR #4349 and removing active labels.