summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-03 15:22:12 -0800
committerisaacs <i@izs.me>2013-03-03 17:26:38 -0800
commite428bb7eaea14adc66374b704049c6e2123a9589 (patch)
treed235c4530b84a449daf1a7472f0074b950897470 /lib
parent384f1be739b747f6589169443ce687b44d434e09 (diff)
downloadandroid-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.js9
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 {