Is there anyway do determine the parent worker id for a worker (i.e.,
the id of the worker that created that worker) within the worker?
So far, I have just been relying on 0 being the main thread id. But,
now, I have a case where I am creating a worker within a worker.
Any help is greatly appreciated. Thanks! :)
-- Steven
You can't. The only way to know is to look at who is sending you
messages (via the senderId param on the onmessage event). Relying on
zero is not a good idea, we don't promise to keep this true.
> I have a case where I am creating a worker within a worker.
Seriously!? :-)
- a
On Aug 30, 5:02 pm, "Aaron Boodman" <a...@google.com> wrote:
> On Aug 30, 2007 4:20 PM, Steven Saviano <ssavi...@gmail.com> wrote:
>
> > Is there anyway do determine the parent worker id for a worker (i.e.,
> > the id of the worker that created that worker) within the worker?
>
> You can't. The only way to know is to look at who is sending you
> messages (via the senderId param on the onmessage event). Relying on
> zero is not a good idea, we don't promise to keep this true.
Sounds good. Will do that.
>
> > I have a case where I am creating a worker within a worker.
>
> Seriously!? :-)
>
Seriously :) Not a different WorkerPool. Same WorkerPool - just more
workers.
> - a