Skip to content

Commit

Permalink
doc: clean up isDead() example
Browse files Browse the repository at this point in the history
This commit removes extra whitespace and some awkward text
containing typos from the cluster worker.isDead() code
sample.

PR-URL: #28421
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Jul 2, 2019
1 parent 0fd6524 commit 96e8b98
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,14 @@ if (cluster.isMaster) {
cluster.on('exit', (worker, code, signal) => {
console.log('worker is dead:', worker.isDead());
});

} else {
// Workers can share any TCP connection
// In this case it is an HTTP server
// Workers can share any TCP connection. In this case, it is an HTTP server.
http.createServer((req, res) => {
res.writeHead(200);
res.end(`Current process\n ${process.pid}`);
process.kill(process.pid);
}).listen(8000);

// Make http://localhost:8000 to ckeck isDead method.
}

```

### worker.kill([signal='SIGTERM'])
Expand Down

0 comments on commit 96e8b98

Please sign in to comment.