diff options
author | isaacs <i@izs.me> | 2013-03-03 15:22:12 -0800 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-03-03 17:26:38 -0800 |
commit | e428bb7eaea14adc66374b704049c6e2123a9589 (patch) | |
tree | d235c4530b84a449daf1a7472f0074b950897470 /lib | |
parent | 384f1be739b747f6589169443ce687b44d434e09 (diff) | |
download | android-node-v8-e428bb7eaea14adc66374b704049c6e2123a9589.tar.gz android-node-v8-e428bb7eaea14adc66374b704049c6e2123a9589.tar.bz2 android-node-v8-e428bb7eaea14adc66374b704049c6e2123a9589.zip |
cluster: Rename destroy() to kill(signal=SIGTERM)
Fix #4133, bringing the cluster worker API more in line with the
child process API.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cluster.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/cluster.js b/lib/cluster.js index 6c0f8f469d..5561c9fbcf 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -401,7 +401,10 @@ Worker.prototype.send = function() { }; // Kill the worker without restarting -Worker.prototype.destroy = function() { +Worker.prototype.kill = Worker.prototype.destroy = function(signal) { + if (!signal) + signal = 'SIGTERM'; + var self = this; this.suicide = true; @@ -411,11 +414,11 @@ Worker.prototype.destroy = function() { // this way the worker won't need to propagate suicide state to master if (self.process.connected) { self.process.once('disconnect', function() { - self.process.kill(); + self.process.kill(signal); }); self.process.disconnect(); } else { - self.process.kill(); + self.process.kill(signal); } } else { |