Permalink
Browse files

cluster: deprecate worker.suicide

Deprecate worker.suicide in favor of worker.exitedAfterDisconnect.

PR-URL: #3747
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
  • Loading branch information...
evanlucas committed Jun 2, 2016
1 parent abd0d68 commit f44b18f010d3548f8429afd415eee0a034bedbf4
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/cluster.js
@@ -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
});

0 comments on commit f44b18f

Please sign in to comment.