mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
abd0d68bea
commit
f44b18f010
@ -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
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user