mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Latest Code
This commit is contained in:
22
launcher.js
Normal file
22
launcher.js
Normal file
@ -0,0 +1,22 @@
|
||||
var cluster = require('cluster');
|
||||
|
||||
require('strong-cluster-connect-store').setup();
|
||||
|
||||
cluster.setupMaster({
|
||||
exec: 'server.js'
|
||||
});
|
||||
|
||||
var cpus = 1;
|
||||
for (var i = 0; i < cpus; i++) {
|
||||
cluster.fork();
|
||||
}
|
||||
|
||||
cluster.on('online', function(worker) {
|
||||
console.log('worker ' + worker.process.pid + ' started.');
|
||||
});
|
||||
|
||||
cluster.on('exit', function(worker, code, signal) {
|
||||
console.log('worker ' + worker.process.pid + ' died');
|
||||
cluster.fork();
|
||||
});
|
||||
|
Reference in New Issue
Block a user