raas-server
Version:
rhamt as a service server
34 lines • 1.86 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const raas_core_1 = require("raas-core");
const serverRunnerDelegate_1 = require("./serverRunnerDelegate");
class ServerRunner {
static run(notificationService, serverRunConfig, installation) {
return __awaiter(this, void 0, void 0, function* () {
return serverRunnerDelegate_1.ServerRunnerDelegate.run(installation.location, String(serverRunConfig.port), serverRunConfig.startTimeout, data => {
notificationService.onServerMessage(serverRunConfig, data);
}).then(cp => {
const handle = {
id: raas_core_1.RhamtModelService.generateUniqueId(),
installationId: serverRunConfig.installation.id,
processId: String(cp.pid),
runConfiguration: serverRunConfig,
startedTimestamp: raas_core_1.RhamtModelService.getTimestamp(),
state: raas_core_1.Protocol.ServerState.STARTED
};
notificationService.onServerStarted(handle);
return { handle, cp };
});
});
}
}
exports.ServerRunner = ServerRunner;
//# sourceMappingURL=serverRunner.js.map