admin管理员组文章数量:1323335
im trying to spawn a web worker inside a web worker but im getting this error:
mainWorker.js:92 Uncaught ReferenceError: Worker is not defined
using this code:
var worker = new Worker('subWorker.js');
worker.postMessage(......);
is this possible in some way??
im trying to spawn a web worker inside a web worker but im getting this error:
mainWorker.js:92 Uncaught ReferenceError: Worker is not defined
using this code:
var worker = new Worker('subWorker.js');
worker.postMessage(......);
is this possible in some way??
Share Improve this question asked Sep 23, 2016 at 16:32 Vanojx1Vanojx1 5,5842 gold badges24 silver badges37 bronze badges 4- 1 You could message the main thread to spawn another Worker thread. – Sebastian Simon Commented Sep 23, 2016 at 16:35
- 1 oh I didn't think about it.... ill try – Vanojx1 Commented Sep 23, 2016 at 16:38
- 2 It should actually work, but it doesn’t work in Chrome and Safari yet. You could try the “detour” over the main thread as a work-around. – Sebastian Simon Commented Sep 25, 2016 at 14:37
- 1 @Vanojx1 It works now. – DavidsKanal Commented Jul 10, 2019 at 17:41
1 Answer
Reset to default 8For anyone who stumbles here, nested workers now have some support in Chrome at least: https://www.chromestatus./feature/6080438103703552:
Dedicated workers can create nested workers, but shared workers and service workers cannot.
Creating a nested dedicated worker from a shared worker is not yet supported.
Nested shared workers are also in the spec, but there is no plan to support them at this time.
本文标签: javascriptWeb worker inside Web worker possibleStack Overflow
版权声明:本文标题:javascript - Web worker inside Web worker possible? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742137434a2422432.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论