summaryrefslogtreecommitdiff
path: root/lib/cluster.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-05-05 15:07:58 -0700
committerisaacs <i@izs.me>2012-05-05 15:20:10 -0700
commit3d84c3db257dfa1b92476cc6a50abf9c6e4b0583 (patch)
treed233982597d9910c8eb0e202b4114aef622cfbf4 /lib/cluster.js
parent1930772693d70998b4d2aab8bcd6972e7ec2d26b (diff)
downloadandroid-node-v8-3d84c3db257dfa1b92476cc6a50abf9c6e4b0583.tar.gz
android-node-v8-3d84c3db257dfa1b92476cc6a50abf9c6e4b0583.tar.bz2
android-node-v8-3d84c3db257dfa1b92476cc6a50abf9c6e4b0583.zip
More cluster event consistency
Regarding discussion in #3198. Passing the worker as an argument to an event emitted on the worker is redundant, and an unnecessary break in consistency vs the events on the ChildProcess objects. It was removed from 'exit', but 'listening' and others were overlooked. This corrects that oversight.
Diffstat (limited to 'lib/cluster.js')
-rw-r--r--lib/cluster.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/cluster.js b/lib/cluster.js
index b2173f0b6c..df3479950e 100644
--- a/lib/cluster.js
+++ b/lib/cluster.js
@@ -184,7 +184,7 @@ if (cluster.isMaster) {
messageHandler.online = function(message, worker) {
worker.state = 'online';
debug('Worker ' + worker.process.pid + ' online');
- worker.emit('online', worker);
+ worker.emit('online');
cluster.emit('online', worker);
};
@@ -213,7 +213,7 @@ if (cluster.isMaster) {
worker.state = 'listening';
// Emit listening, now that we know the worker is listening
- worker.emit('listening', worker, {
+ worker.emit('listening', {
address: message.address,
port: message.port,
addressType: message.addressType
@@ -297,7 +297,7 @@ function Worker(customEnv) {
this.process.once('exit', function(exitCode, signalCode) {
prepareExit(self, 'dead');
self.emit('exit', exitCode, signalCode);
- cluster.emit('exit', self);
+ cluster.emit('exit', self, exitCode, signalCode);
});
this.process.once('disconnect', function() {
prepareExit(self, 'disconnected');