cluster: deprecate worker.suicide

Deprecate worker.suicide in favor of worker.exitedAfterDisconnect.

PR-URL: https://github.com/nodejs/node/pull/3747
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This commit is contained in:
Evan Lucas 2016-06-02 06:45:33 -05:00
parent abd0d68bea
commit f44b18f010

View File

@ -6,6 +6,7 @@ const dgram = require('dgram');
const fork = require('child_process').fork;
const net = require('net');
const util = require('util');
const internalUtil = require('internal/util');
const SCHED_NONE = 1;
const SCHED_RR = 2;
@ -30,14 +31,14 @@ function Worker(options) {
this.exitedAfterDisconnect = undefined;
Object.defineProperty(this, 'suicide', {
get: function() {
// TODO: Print deprecation message.
get: internalUtil.deprecate(() => {
return this.exitedAfterDisconnect;
},
set: function(val) {
// TODO: Print deprecation message.
}, 'worker.suicide is deprecated. ' +
'Please use worker.exitedAfterDisconnect.'),
set: internalUtil.deprecate((val) => {
this.exitedAfterDisconnect = val;
},
}, 'worker.suicide is deprecated. ' +
'Please use worker.exitedAfterDisconnect.'),
enumerable: true
});