joyent/node — pull request #2038 by AndreasMadsen (2011-11-07 15:22:12+00:00)
Title: Made cluster more plugin friendly and easy to use

The purpose of this is to make the cluster module more plugin friendly, and make it easier to setup a cluster.

I've added a "fork", "online", and "listening" events, there will be emitted in the master.

I allow made the eachWorker, startMaster (new setupMaster) to the master, and the queryMaster (new worker.send) public to the worker.

There has been made a autoFork function, so the developer don't need to use the .fork, they will properly use the child_process.fork if they wan't that much control, (cluster.fork is still available).

I've fixed some syntax, and corrected the eachWorker call from within the uncaughtException event – the function didn't exist.

Testcases are not something i'm good at, but i've created one for cluster events and hope it's enough.

The documentation still need to be written, since i wasn't sure if this would be accepted.