flowed
Version:
A fast and reliable flow engine for orchestration and more uses in *Node.js*, *Deno* and the browser
30 lines • 1.08 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FlowReady = void 0;
const _1 = require(".");
const types_1 = require("../../types");
class FlowReady extends _1.FlowState {
getStateCode() {
return types_1.FlowStateEnum.Ready;
}
start(params, expectedResults, resolvers, context, options = {}) {
this.setRunOptions(options);
this.log({ n: this.runStatus.id, m: 'Flow started with params: %O', mp: params, e: 'FS' });
this.setState(types_1.FlowStateEnum.Running);
this.setExpectedResults([...expectedResults]);
this.setResolvers(resolvers);
this.setContext(context);
this.supplyParameters(params);
this.createFinishPromise();
this.startReadyTasks();
if (!this.runStatus.state.isRunning()) {
this.runStatus.state.finished();
}
return this.runStatus.finishPromise;
}
getSerializableState() {
return this.runStatus.toSerializable();
}
}
exports.FlowReady = FlowReady;
//# sourceMappingURL=flow-ready.js.map