mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
1dba1620bb
PR-URL: https://github.com/nodejs/node/pull/16916 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
8 lines
209 B
JavaScript
8 lines
209 B
JavaScript
const cluster = require('cluster');
|
|
if (cluster.isMaster) {
|
|
cluster.fork(); // one child
|
|
cluster.on('exit', function(worker, code, signal) {
|
|
console.log(`worker terminated with code ${code}`);
|
|
});
|
|
}
|