UNPKG

flowed

Version:

A fast and reliable flow engine for orchestration and more uses in *Node.js*, *Deno* and the browser

42 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Flow = void 0; const flow_run_status_1 = require("./flow-run-status"); const debug_1 = require("../debug"); const flow_manager_1 = require("./flow-manager"); const flow_state_1 = require("./flow-state"); class Flow { constructor(spec, runState) { this.runStatus = new flow_run_status_1.FlowRunStatus(this, spec !== null && spec !== void 0 ? spec : {}, runState); } getStateCode() { return this.runStatus.state.getStateCode(); } start(params = {}, expectedResults = [], resolvers = {}, context = {}, options = {}) { return this.runStatus.state.start(params, expectedResults, resolvers, context, options); } pause() { return this.runStatus.state.pause(); } resume() { return this.runStatus.state.resume(); } stop() { return this.runStatus.state.stop(); } reset() { this.runStatus.state.reset(); } getSerializableState() { return this.runStatus.state.getSerializableState(); } debug(formatter, ...args) { (this === null || this === void 0 ? void 0 : this.runStatus) ? this.runStatus.state.debug(formatter, ...args) : (0, debug_1.default)('init')(formatter, ...args); } log({ n, m, mp, l, e }) { this.debug(flow_state_1.FlowState.formatDebugMessage({ n, m, mp, l, e }), [mp]); flow_manager_1.FlowManager.log(flow_state_1.FlowState.createLogEntry({ n, m, mp, l, e }, this.runStatus)); } } exports.Flow = Flow; //# sourceMappingURL=flow.js.map