doc: replace references to cluster.autoFork
authorAndreas Madsen <amwebdk@gmail.com>
Mon, 25 Jun 2012 16:53:35 +0000 (18:53 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 25 Jun 2012 21:17:18 +0000 (23:17 +0200)
doc/api/cluster.markdown

index 1332bd4..059037b 100644 (file)
@@ -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);
       });