Vanojx1
Vanojx1

Reputation: 5574

Web worker inside Web worker possible?

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??

Upvotes: 8

Views: 4159

Answers (1)

see sharper
see sharper

Reputation: 12025

For anyone who stumbles here, nested workers now have some support in Chrome at least: https://www.chromestatus.com/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.

Upvotes: 7

Related Questions