blob: 570cb83bdc496ed0813f3d42a5d91cf753b25818 (
plain)
1
2
3
4
5
6
7
|
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}`);
});
}
|