Skip to content

Commit

Permalink
add suicide to master to kill all workers
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoper committed Aug 6, 2012
1 parent 0148e48 commit 591cf84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Expand Up @@ -39,6 +39,12 @@ function ClusterFork() {
return cluster.workers[workerId];
};

this.suicide = function(cb) {
cluster.disconnect(function() {
cb();
});
};

Object.defineProperty(emitted, 'nextWorker', { get: this.requestWorker });
Object.defineProperty(emitted, 'numWorkers', { value: numCPUs, writable: false });

Expand Down

0 comments on commit 591cf84

Please sign in to comment.