Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

cluster: Remove eachWorker, workerCount

unnecessary
  • Loading branch information...
ry committed Nov 4, 2011
1 parent 8652848 commit d42006c80a9c827e4c147e22f56bb3d789f578ce
Showing with 1 addition and 22 deletions.
  1. +0 −12 doc/api/cluster.markdown
  2. +1 −10 lib/cluster.js
@@ -45,18 +45,6 @@ Boolean flags to determine if the current process is a master or a worker
process in a cluster. A process `isMaster` if `process.env.NODE_WORKER_ID`
is undefined.

### cluster.eachWorker(cb)

Synchronously iterates over all of the workers.

cluster.eachWorker(function(worker) {
console.log("worker pid=" + worker.pid);
});

### cluster.workerCount()

Returns the number of workers.

### Event: 'death'

When any of the workers die the cluster module will emit the 'death' event.
@@ -128,7 +128,7 @@ function handleWorkerMessage(worker, message) {
}


cluster.eachWorker = function(cb) {
function eachWorker(cb) {
// This can only be called from the master.
assert(cluster.isMaster);

@@ -140,15 +140,6 @@ cluster.eachWorker = function(cb) {
};


cluster.workerCount = function() {
var c = 0;
cluster.eachWorker(function() {
c++;
});
return c;
};


cluster.fork = function() {
// This can only be called from the master.
assert(cluster.isMaster);

2 comments on commit d42006c

@jtokoph

This comment has been minimized.

Copy link

replied Nov 7, 2011

There is still a reference to cluster.eachWorker on line 83 of cluster.js:
https://github.com/joyent/node/blob/d42006c80a9c827e4c147e22f56bb3d789f578ce/lib/cluster.js#L83

@bnoordhuis

This comment has been minimized.

Copy link
Member

replied Nov 8, 2011

Thanks. Fixed in 105d178.

Please sign in to comment.
You can’t perform that action at this time.