doc: clean up isDead() example
This commit removes extra whitespace and some awkward text containing typos from the cluster worker.isDead() code sample. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
94454927f6
commit
63a5cd87ea
@ -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'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user