Skip to content

Commit

Permalink
cluster: deprecate worker.suicide
Browse files Browse the repository at this point in the history
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 5, 2016
1 parent abd0d68 commit f44b18f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
});

Expand Down

0 comments on commit f44b18f

Please sign in to comment.