Permalink
Browse files

doc: replace references to cluster.autoFork

  • Loading branch information...
1 parent 41a4b73 commit 3d51646c4b9e10ccfe901cd48020b32f72bc3b03 @AndreasMadsen AndreasMadsen committed with bnoordhuis Jun 25, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 doc/api/cluster.markdown
View
@@ -233,7 +233,7 @@ Example:
args : ["--use", "https"],
silent : true
});
- cluster.autoFork();
+ cluster.fork();
## cluster.fork([env])
@@ -436,7 +436,11 @@ in the master process using the message system:
}
// Start workers and listen for messages containing notifyRequest
- cluster.autoFork();
+ var numCPUs = require('os').cpus().length;
+ for (var i = 0; i < numCPUs; i++) {
+ cluster.fork();
+ }
+
Object.keys(cluster.workers).forEach(function(id) {
cluster.workers[id].on('message', messageHandler);
});

0 comments on commit 3d51646

Please sign in to comment.