forked from LeenkxTeam/Kmake
8 lines
210 B
JavaScript
8 lines
210 B
JavaScript
const cluster = require('cluster');
|
|
if (cluster.isPrimary) {
|
|
cluster.fork(); // one child
|
|
cluster.on('exit', function(worker, code, signal) {
|
|
console.log(`worker terminated with code ${code}`);
|
|
});
|
|
}
|