update to fix tests

This commit is contained in:
Iuri Matias 2018-07-26 12:37:33 -04:00
parent 062de6b4fb
commit a706dd0638

View File

@ -8,29 +8,25 @@ class ProcessManager {
this.processes = {};
self.events.setCommandHandler('processes:register', (name, cb) => {
console.dir("=====> registering " + name);
this.processes[name] = {
state: 'unstarted',
cb: cb
}
};
});
self.events.setCommandHandler('processes:launch', (name, cb) => {
let process = self.processes[name];
// TODO: should make distinction between starting and running
if (process.state != 'unstarted') {
console.dir("=====> already started " + name);
return cb();
}
console.dir("=====> launching " + name);
process.state = 'starting';
//let pry = require('pryjs');
//eval(pry.it);
process.cb.apply(process.cb, [() => {
process.state = 'running';
console.dir("=====> launched " + name);
cb();
}]);
process.cb.apply(process.cb, [
() => {
process.state = 'running';
cb();
}
]);
});
}