On Tue, May 22, 2012 at 4:49 AM, Lukhnos Liu <[email protected]> wrote:
> Is there any consideration in keeping a worker process (from cluster.fork())
> from calling cluster.fork() again? What I have in mind is porting a program
> written with HTML5 web worker that uses subworkers. I think I can use
> child_process.fork() too, but cluster.fork() has done a lot of bookkeeping
> (and port sharing) for us.
>
> I found that the first line in the source of cluster.fork is just
> "assert(cluster.isMaster);". I haven't explored further yet, but I'm curious
> what the considerations are, and what possible hurdles one needs to overcome
> if we wants to allow a worker to fork further with cluster.fork().

A hierarchy of master/workers wasn't seriously considered when we
wrote the cluster module. Removing the assert and calling .fork() in
your workers may work. Then again, it may not.

If you have a legitimate use case ("I want Node to be more like
Erlang" doesn't count), open an issue and we can look into it. Even
better, submit a pull request. :-)

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to