diff options
author | Michael Dawson <mdawson@devrus.com> | 2020-12-11 00:53:44 +0300 |
---|---|---|
committer | Michael Dawson <mdawson@devrus.com> | 2021-01-05 23:41:45 +0300 |
commit | 15164cebcebfcad9822d3f065234a8c1511776a4 (patch) | |
tree | f9ce2f183ba5af0ff50e104d72af58dbbc40c943 /doc/api/domain.md | |
parent | 3c49ee298fd52295f4cff301a739d43b3ecf0d24 (diff) |
lib,src: update cluster to use Parent
Doc deprecate isMaster and setupMaster in favor
of isPrimary and setupPrimary.
Signed-off-by: Michael Dawson <mdawson@devrus.com>
PR-URL: https://github.com/nodejs/node/pull/36478
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Diffstat (limited to 'doc/api/domain.md')
-rw-r--r-- | doc/api/domain.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/api/domain.md b/doc/api/domain.md index c7aabd489bd..fac15518365 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -55,7 +55,7 @@ triggered the error, while letting the others finish in their normal time, and stop listening for new requests in that worker. In this way, `domain` usage goes hand-in-hand with the cluster module, -since the master process can fork a new worker when a worker +since the primary process can fork a new worker when a worker encounters an error. For Node.js programs that scale to multiple machines, the terminating proxy or service registry can take note of the failure, and react accordingly. @@ -90,9 +90,9 @@ appropriately, and handle errors with much greater safety. const cluster = require('cluster'); const PORT = +process.env.PORT || 1337; -if (cluster.isMaster) { +if (cluster.isPrimary) { // A more realistic scenario would have more than 2 workers, - // and perhaps not put the master and worker in the same file. + // and perhaps not put the primary and worker in the same file. // // It is also possible to get a bit fancier about logging, and // implement whatever custom logic is needed to prevent DoS @@ -100,7 +100,7 @@ if (cluster.isMaster) { // // See the options in the cluster documentation. // - // The important thing is that the master does very little, + // The important thing is that the primary does very little, // increasing our resilience to unexpected errors. cluster.fork(); @@ -142,8 +142,8 @@ if (cluster.isMaster) { // Stop taking new requests. server.close(); - // Let the master know we're dead. This will trigger a - // 'disconnect' in the cluster master, and then it will fork + // Let the primary know we're dead. This will trigger a + // 'disconnect' in the cluster primary, and then it will fork // a new worker. cluster.worker.disconnect(); |