communication between loader and child
parent
ef63d816fe
commit
64c4dd7e63
@ -0,0 +1,19 @@
|
||||
var fork = require('child_process').fork,
|
||||
start = function() {
|
||||
var nbb = fork('./app', [], {
|
||||
env: {
|
||||
'NODE_ENV': 'development'
|
||||
}
|
||||
});
|
||||
|
||||
nbb.on('message', function(cmd) {
|
||||
if (cmd === 'nodebb:restart') {
|
||||
nbb.kill();
|
||||
setTimeout(function() {
|
||||
start();
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
start();
|
Loading…
Reference in New Issue