From 3d51646c4b9e10ccfe901cd48020b32f72bc3b03 Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Mon, 25 Jun 2012 18:53:35 +0200 Subject: [PATCH] doc: replace references to cluster.autoFork --- doc/api/cluster.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/cluster.markdown b/doc/api/cluster.markdown index 1332bd4eed..059037bc74 100644 --- a/doc/api/cluster.markdown +++ b/doc/api/cluster.markdown @@ -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); });