From 1fcb76e8f2f05fc084337da097a17b06cc7d0c68 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 15 Jun 2017 08:31:11 -0700 Subject: [PATCH] cluster: remove deprecated property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/13702 Reviewed-By: Refael Ackermann Reviewed-By: Sam Roberts Reviewed-By: Tobias Nießen Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen --- doc/api/cluster.md | 34 ---------------------------------- lib/internal/cluster/worker.js | 14 -------------- 2 files changed, 48 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index c7d8359ac0ce93..721b33a7e184f1 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -451,40 +451,6 @@ if (cluster.isMaster) { } ``` -### worker.suicide - - -> Stability: 0 - Deprecated: Use [`worker.exitedAfterDisconnect`][] instead. - -An alias to [`worker.exitedAfterDisconnect`][]. - -Set by calling `.kill()` or `.disconnect()`. Until then, it is `undefined`. - -The boolean `worker.suicide` is used to distinguish between voluntary -and accidental exit, the master may choose not to respawn a worker based on -this value. - -```js -cluster.on('exit', (worker, code, signal) => { - if (worker.suicide === true) { - console.log('Oh, it was just voluntary – no need to worry'); - } -}); - -// kill worker -worker.kill(); -``` - -This API only exists for backwards compatibility and will be removed in the -future. - ## Event: 'disconnect'