@dbos-inc/dbos-sdk 1.24.11-preview → 1.24.15
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/schemas/system_db_schema.d.ts +8 -0
- package/dist/schemas/system_db_schema.d.ts.map +1 -1
- package/dist/src/dbos-executor.d.ts +9 -9
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +69 -40
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.js +1 -1
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.d.ts +2 -2
- package/dist/src/dbos-runtime/runtime.d.ts +6 -0
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +14 -1
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.d.ts +5 -4
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
- package/dist/src/debugger/debug_workflow.js +11 -11
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/decorators.d.ts +4 -4
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +3 -3
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/eventreceiver.d.ts +2 -2
- package/dist/src/eventreceiver.d.ts.map +1 -1
- package/dist/src/httpServer/handler.d.ts +5 -4
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +11 -11
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/scheduler/scheduler.d.ts +0 -1
- package/dist/src/scheduler/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler/scheduler.js +0 -3
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/{communicator.d.ts → step.d.ts} +6 -7
- package/dist/src/step.d.ts.map +1 -0
- package/dist/src/{communicator.js → step.js} +4 -4
- package/dist/src/step.js.map +1 -0
- package/dist/src/system_database.d.ts +8 -0
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +106 -7
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +6 -5
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +14 -6
- package/dist/src/testing/testing_runtime.js.map +1 -1
- package/dist/src/wfqueue.d.ts +28 -0
- package/dist/src/wfqueue.d.ts.map +1 -0
- package/dist/src/wfqueue.js +70 -0
- package/dist/src/wfqueue.js.map +1 -0
- package/dist/src/workflow.d.ts +15 -10
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +22 -21
- package/dist/src/workflow.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migrations/20240924000000_workflowqueue.js +24 -0
- package/package.json +1 -1
- package/dist/src/communicator.d.ts.map +0 -1
- package/dist/src/communicator.js.map +0 -1
@@ -10,6 +10,7 @@ import { WorkflowHandle } from "../workflow";
|
|
10
10
|
import { Http2ServerRequest, Http2ServerResponse } from "http2";
|
11
11
|
import { ServerResponse } from "http";
|
12
12
|
import { SystemDatabase } from "../system_database";
|
13
|
+
import { WorkflowQueue } from "../wfqueue";
|
13
14
|
/**
|
14
15
|
* Create a testing runtime. Warn: this function will drop the existing system DB and create a clean new one. Don't run tests against your production database!
|
15
16
|
*/
|
@@ -24,8 +25,8 @@ export interface TestingRuntime {
|
|
24
25
|
invoke<T extends object>(targetClass: T, workflowUUID?: string, params?: WorkflowInvokeParams): InvokeFuncs<T>;
|
25
26
|
invokeWorkflow<T extends ConfiguredInstance>(targetCfg: T, workflowUUID?: string, params?: WorkflowInvokeParams): SyncHandlerWfFuncsInst<T>;
|
26
27
|
invokeWorkflow<T extends object>(targetClass: T, workflowUUID?: string, params?: WorkflowInvokeParams): SyncHandlerWfFuncs<T>;
|
27
|
-
startWorkflow<T extends ConfiguredInstance>(targetCfg: T, workflowUUID?: string, params?: WorkflowInvokeParams): AsyncHandlerWfFuncInst<T>;
|
28
|
-
startWorkflow<T extends object>(targetClass: T, workflowUUID?: string, params?: WorkflowInvokeParams): AsyncHandlerWfFuncs<T>;
|
28
|
+
startWorkflow<T extends ConfiguredInstance>(targetCfg: T, workflowUUID?: string, params?: WorkflowInvokeParams, queue?: WorkflowQueue): AsyncHandlerWfFuncInst<T>;
|
29
|
+
startWorkflow<T extends object>(targetClass: T, workflowUUID?: string, params?: WorkflowInvokeParams, queue?: WorkflowQueue): AsyncHandlerWfFuncs<T>;
|
29
30
|
retrieveWorkflow<R>(workflowUUID: string): WorkflowHandle<R>;
|
30
31
|
send<T>(destinationUUID: string, message: T, topic?: string, idempotencyKey?: string): Promise<void>;
|
31
32
|
getEvent<T>(workflowUUID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
|
@@ -65,11 +66,11 @@ export declare class TestingRuntimeImpl implements TestingRuntime {
|
|
65
66
|
setConfig<T>(key: string, newValue: T): void;
|
66
67
|
/**
|
67
68
|
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
68
|
-
* to invoke workflows, transactions, and
|
69
|
+
* to invoke workflows, transactions, and steps;
|
69
70
|
*/
|
70
|
-
mainInvoke<T extends object>(object: T, workflowUUID: string | undefined, params: WorkflowInvokeParams | undefined, asyncWf: boolean, clsinst: ConfiguredInstance | null): InvokeFuncs<T>;
|
71
|
+
mainInvoke<T extends object>(object: T, workflowUUID: string | undefined, params: WorkflowInvokeParams | undefined, asyncWf: boolean, clsinst: ConfiguredInstance | null, queue?: WorkflowQueue): InvokeFuncs<T>;
|
71
72
|
invoke<T extends object>(object: T | ConfiguredInstance, workflowUUID?: string, params?: WorkflowInvokeParams): InvokeFuncs<T> | InvokeFuncsInst<T>;
|
72
|
-
startWorkflow<T extends object>(object: T, workflowUUID?: string, params?: WorkflowInvokeParams): AsyncHandlerWfFuncs<T> | AsyncHandlerWfFuncInst<T>;
|
73
|
+
startWorkflow<T extends object>(object: T, workflowUUID?: string, params?: WorkflowInvokeParams, queue?: WorkflowQueue): AsyncHandlerWfFuncs<T> | AsyncHandlerWfFuncInst<T>;
|
73
74
|
invokeWorkflow<T extends object>(object: T | ConfiguredInstance, workflowUUID?: string, params?: WorkflowInvokeParams): SyncHandlerWfFuncs<T> | SyncHandlerWfFuncsInst<T>;
|
74
75
|
/**
|
75
76
|
* Return a request handler callback for node's native http/http2 server, which includes all registered HTTP endpoints.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"testing_runtime.d.ts","sourceRoot":"","sources":["../../../src/testing/testing_runtime.ts"],"names":[],"mappings":";;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE9J,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAY,cAAc,EAAkB,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"testing_runtime.d.ts","sourceRoot":"","sources":["../../../src/testing/testing_runtime.ts"],"names":[],"mappings":";;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAmB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE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gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAItD,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAK3D,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;OAEG;IACH,WAAW,IAAI,YAAY;CAM5B"}
|
@@ -10,6 +10,8 @@ const config_1 = require("../dbos-runtime/config");
|
|
10
10
|
const lodash_1 = require("lodash");
|
11
11
|
const pg_1 = require("pg");
|
12
12
|
const scheduler_1 = require("../scheduler/scheduler");
|
13
|
+
const wfqueue_1 = require("../wfqueue");
|
14
|
+
const runtime_1 = require("../dbos-runtime/runtime");
|
13
15
|
/**
|
14
16
|
* Create a testing runtime. Warn: this function will drop the existing system DB and create a clean new one. Don't run tests against your production database!
|
15
17
|
*/
|
@@ -47,6 +49,7 @@ exports.createInternalTestRuntime = createInternalTestRuntime;
|
|
47
49
|
class TestingRuntimeImpl {
|
48
50
|
#server = null;
|
49
51
|
#scheduler = null;
|
52
|
+
#wfQueueRunner = null;
|
50
53
|
#applicationConfig = {};
|
51
54
|
#isInitialized = false;
|
52
55
|
/**
|
@@ -55,7 +58,9 @@ class TestingRuntimeImpl {
|
|
55
58
|
*/
|
56
59
|
async init(userClasses, testConfig, systemDB) {
|
57
60
|
const dbosConfig = testConfig ? [testConfig] : (0, config_1.parseConfigFile)();
|
61
|
+
runtime_1.DBOS.dbosConfig = dbosConfig[0];
|
58
62
|
const dbosExec = new dbos_executor_1.DBOSExecutor(dbosConfig[0], systemDB);
|
63
|
+
runtime_1.DBOS.globalLogger = dbosExec.logger;
|
59
64
|
await dbosExec.init(userClasses);
|
60
65
|
this.#server = new server_1.DBOSHttpServer(dbosExec);
|
61
66
|
for (const evtRcvr of dbosExec.eventReceivers) {
|
@@ -63,6 +68,7 @@ class TestingRuntimeImpl {
|
|
63
68
|
}
|
64
69
|
this.#scheduler = new scheduler_1.DBOSScheduler(dbosExec);
|
65
70
|
this.#scheduler.initScheduler();
|
71
|
+
this.#wfQueueRunner = wfqueue_1.wfQueueRunner.dispatchLoop(dbosExec);
|
66
72
|
this.#applicationConfig = dbosExec.config.application ?? {};
|
67
73
|
this.#isInitialized = true;
|
68
74
|
}
|
@@ -72,6 +78,8 @@ class TestingRuntimeImpl {
|
|
72
78
|
async destroy() {
|
73
79
|
// Only release once.
|
74
80
|
if (this.#isInitialized) {
|
81
|
+
wfqueue_1.wfQueueRunner.stop();
|
82
|
+
await this.#wfQueueRunner;
|
75
83
|
await this.#scheduler?.destroyScheduler();
|
76
84
|
for (const evtRcvr of this.#server?.dbosExec?.eventReceivers || []) {
|
77
85
|
await evtRcvr.destroy();
|
@@ -92,9 +100,9 @@ class TestingRuntimeImpl {
|
|
92
100
|
}
|
93
101
|
/**
|
94
102
|
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
95
|
-
* to invoke workflows, transactions, and
|
103
|
+
* to invoke workflows, transactions, and steps;
|
96
104
|
*/
|
97
|
-
mainInvoke(object, workflowUUID, params, asyncWf, clsinst) {
|
105
|
+
mainInvoke(object, workflowUUID, params, asyncWf, clsinst, queue) {
|
98
106
|
const dbosExec = this.getDBOSExec();
|
99
107
|
const ops = (0, decorators_1.getRegisteredOperations)(clsinst ? clsinst : object);
|
100
108
|
const proxy = {};
|
@@ -104,7 +112,7 @@ class TestingRuntimeImpl {
|
|
104
112
|
oc.authenticatedUser = params?.authenticatedUser ?? "";
|
105
113
|
oc.request = params?.request ?? {};
|
106
114
|
oc.authenticatedRoles = params?.authenticatedRoles ?? [];
|
107
|
-
const wfParams = { workflowUUID: workflowUUID, parentCtx: oc, configuredInstance: clsinst };
|
115
|
+
const wfParams = { workflowUUID: workflowUUID, parentCtx: oc, configuredInstance: clsinst, queueName: queue?.name };
|
108
116
|
for (const op of ops) {
|
109
117
|
if (asyncWf) {
|
110
118
|
proxy[op.name] = op.txnConfig
|
@@ -134,13 +142,13 @@ class TestingRuntimeImpl {
|
|
134
142
|
return this.mainInvoke(targetInst.constructor, workflowUUID, params, true, targetInst);
|
135
143
|
}
|
136
144
|
}
|
137
|
-
startWorkflow(object, workflowUUID, params) {
|
145
|
+
startWorkflow(object, workflowUUID, params, queue) {
|
138
146
|
if (typeof object === 'function') {
|
139
|
-
return this.mainInvoke(object, workflowUUID, params, true, null);
|
147
|
+
return this.mainInvoke(object, workflowUUID, params, true, null, queue);
|
140
148
|
}
|
141
149
|
else {
|
142
150
|
const targetInst = object;
|
143
|
-
return this.mainInvoke(targetInst.constructor, workflowUUID, params, true, targetInst);
|
151
|
+
return this.mainInvoke(targetInst.constructor, workflowUUID, params, true, targetInst, queue);
|
144
152
|
}
|
145
153
|
}
|
146
154
|
invokeWorkflow(object, workflowUUID, params) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"testing_runtime.js","sourceRoot":"","sources":["../../../src/testing/testing_runtime.ts"],"names":[],"mappings":";;;AAGA,wCAA0D;AAC1D,8CAA4E;AAC5E,oCAA6D;AAE7D,iDAAsD;AACtD,oDAA4D;AAC5D,mDAA6E;AAM7E,mCAAkC;AAClC,2BAA4B;AAC5B,sDAAuD;
|
1
|
+
{"version":3,"file":"testing_runtime.js","sourceRoot":"","sources":["../../../src/testing/testing_runtime.ts"],"names":[],"mappings":";;;AAGA,wCAA0D;AAC1D,8CAA4E;AAC5E,oCAA6D;AAE7D,iDAAsD;AACtD,oDAA4D;AAC5D,mDAA6E;AAM7E,mCAAkC;AAClC,2BAA4B;AAC5B,sDAAuD;AAEvD,wCAA0D;AAC1D,qDAA+C;AAE/C;;GAEG;AACI,KAAK,UAAU,oBAAoB,CAAC,cAAoC,SAAS,EAAE,iBAAyB,2BAAkB,EAAE,YAAqB,IAAI;IAC9J,MAAM,CAAC,UAAU,CAAC,GAAG,IAAA,wBAA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AC;IAC3D,CAAC;IAED,KAAK,CAAC,WAAW,CAAI,GAAW,EAAE,GAAG,MAAa;QAChD,iEAAiE;QACjE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;IACxD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,iBAAS,CAAC,qEAAqE,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACF;AA5LD,gDA4LC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { DBOSExecutor } from "./dbos-executor";
|
2
|
+
/**
|
3
|
+
Limit the maximum number of functions from this queue
|
4
|
+
that can be started in a given period.
|
5
|
+
If the limit is 5 and the period is 10, no more than 5 functions can be
|
6
|
+
started per 10 seconds.
|
7
|
+
*/
|
8
|
+
interface QueueRateLimit {
|
9
|
+
limitPerPeriod: number;
|
10
|
+
periodSec: number;
|
11
|
+
}
|
12
|
+
export declare class WorkflowQueue {
|
13
|
+
readonly name: string;
|
14
|
+
readonly concurrency?: number | undefined;
|
15
|
+
readonly rateLimit?: QueueRateLimit | undefined;
|
16
|
+
constructor(name: string, concurrency?: number | undefined, rateLimit?: QueueRateLimit | undefined);
|
17
|
+
}
|
18
|
+
declare class WFQueueRunner {
|
19
|
+
readonly wfQueuesByName: Map<string, WorkflowQueue>;
|
20
|
+
private isRunning;
|
21
|
+
private interruptResolve?;
|
22
|
+
stop(): void;
|
23
|
+
dispatchLoop(exec: DBOSExecutor): Promise<void>;
|
24
|
+
logRegisteredEndpoints(exec: DBOSExecutor): void;
|
25
|
+
}
|
26
|
+
export declare const wfQueueRunner: WFQueueRunner;
|
27
|
+
export {};
|
28
|
+
//# sourceMappingURL=wfqueue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wfqueue.d.ts","sourceRoot":"","sources":["../../src/wfqueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;;;EAKE;AACF,UAAU,cAAc;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,aAAa;IACV,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,QAAQ,CAAC,WAAW,CAAC;IAAU,QAAQ,CAAC,SAAS,CAAC;gBAAhE,IAAI,EAAE,MAAM,EAAW,WAAW,CAAC,oBAAQ,EAAW,SAAS,CAAC,4BAAgB;CAMxG;AAED,cAAM,aAAa;IAEf,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAa;IAEhE,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,gBAAgB,CAAC,CAAa;IAEtC,IAAI;IAQE,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCrD,sBAAsB,CAAC,IAAI,EAAE,YAAY;CAQ5C;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.wfQueueRunner = exports.WorkflowQueue = void 0;
|
4
|
+
const error_1 = require("./error");
|
5
|
+
class WorkflowQueue {
|
6
|
+
name;
|
7
|
+
concurrency;
|
8
|
+
rateLimit;
|
9
|
+
constructor(name, concurrency, rateLimit) {
|
10
|
+
this.name = name;
|
11
|
+
this.concurrency = concurrency;
|
12
|
+
this.rateLimit = rateLimit;
|
13
|
+
if (exports.wfQueueRunner.wfQueuesByName.has(name)) {
|
14
|
+
throw new error_1.DBOSInitializationError(`Workflow Queue '${name}' defined multiple times`);
|
15
|
+
}
|
16
|
+
exports.wfQueueRunner.wfQueuesByName.set(name, this);
|
17
|
+
}
|
18
|
+
}
|
19
|
+
exports.WorkflowQueue = WorkflowQueue;
|
20
|
+
class WFQueueRunner {
|
21
|
+
wfQueuesByName = new Map();
|
22
|
+
isRunning = false;
|
23
|
+
interruptResolve;
|
24
|
+
stop() {
|
25
|
+
if (!this.isRunning)
|
26
|
+
return;
|
27
|
+
this.isRunning = false;
|
28
|
+
if (this.interruptResolve) {
|
29
|
+
this.interruptResolve();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
async dispatchLoop(exec) {
|
33
|
+
this.isRunning = true;
|
34
|
+
while (this.isRunning) {
|
35
|
+
// Wait for either the timeout or an interruption
|
36
|
+
let timer;
|
37
|
+
const timeoutPromise = new Promise((resolve) => {
|
38
|
+
timer = setTimeout(() => {
|
39
|
+
resolve();
|
40
|
+
}, 1000);
|
41
|
+
});
|
42
|
+
await Promise.race([
|
43
|
+
timeoutPromise,
|
44
|
+
new Promise((_, reject) => this.interruptResolve = reject)
|
45
|
+
])
|
46
|
+
.catch(() => { exec.logger.debug("Workflow queue loop interrupted!"); }); // Interrupt sleep throws
|
47
|
+
clearTimeout(timer);
|
48
|
+
if (!this.isRunning) {
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
// Check queues
|
52
|
+
for (const [_qn, q] of this.wfQueuesByName) {
|
53
|
+
const wfids = await exec.systemDatabase.findAndMarkStartableWorkflows(q);
|
54
|
+
for (const wfid of wfids) {
|
55
|
+
const _wfh = await exec.executeWorkflowUUID(wfid);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
logRegisteredEndpoints(exec) {
|
61
|
+
const logger = exec.logger;
|
62
|
+
logger.info("Workflow queues:");
|
63
|
+
for (const [qn, q] of this.wfQueuesByName) {
|
64
|
+
const conc = q.concurrency !== undefined ? `${q.concurrency}` : 'No concurrency limit set';
|
65
|
+
logger.info(` ${qn}: ${conc}`);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
exports.wfQueueRunner = new WFQueueRunner();
|
70
|
+
//# sourceMappingURL=wfqueue.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wfqueue.js","sourceRoot":"","sources":["../../src/wfqueue.ts"],"names":[],"mappings":";;;AACA,mCAAkD;AAalD,MAAa,aAAa;IACD;IAAuB;IAA+B;IAA3E,YAAqB,IAAY,EAAW,WAAoB,EAAW,SAA0B;QAAhF,SAAI,GAAJ,IAAI,CAAQ;QAAW,gBAAW,GAAX,WAAW,CAAS;QAAW,cAAS,GAAT,SAAS,CAAiB;QACjG,IAAI,qBAAa,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,+BAAuB,CAAC,mBAAmB,IAAI,0BAA0B,CAAC,CAAC;QACzF,CAAC;QACD,qBAAa,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;CACJ;AAPD,sCAOC;AAED,MAAM,aAAa;IAEN,cAAc,GAA+B,IAAI,GAAG,EAAE,CAAC;IAExD,SAAS,GAAY,KAAK,CAAC;IAC3B,gBAAgB,CAAc;IAEtC,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAkB;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC,SAAS,EAA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AAG,CAAC,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,0BAA0B,CAAC;YAC3F,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC;IACL,CAAC;CACJ;AAEY,QAAA,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
package/dist/src/workflow.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DBOSExecutor } from "./dbos-executor";
|
2
2
|
import { Transaction, TransactionContext } from "./transaction";
|
3
|
-
import {
|
3
|
+
import { StepFunction, StepContext } from "./step";
|
4
4
|
import { SystemDatabase } from "./system_database";
|
5
5
|
import { UserDatabaseClient } from "./user_database";
|
6
6
|
import { HTTPRequest, DBOSContext, DBOSContextImpl } from './context';
|
@@ -8,11 +8,12 @@ import { ConfiguredInstance } from "./decorators";
|
|
8
8
|
import { StoredProcedure, StoredProcedureContext } from "./procedure";
|
9
9
|
import { InvokeFuncsInst } from "./httpServer/handler";
|
10
10
|
import { PoolClient } from "pg";
|
11
|
+
import { WorkflowQueue } from "./wfqueue";
|
11
12
|
export type Workflow<T extends unknown[], R> = (ctxt: WorkflowContext, ...args: T) => Promise<R>;
|
12
13
|
export type WorkflowFunction<T extends unknown[], R> = Workflow<T, R>;
|
13
14
|
export type TailParameters<T extends (arg: any, args: any[]) => any> = T extends (arg: any, ...args: infer P) => any ? P : never;
|
14
15
|
type TxFunc = (ctxt: TransactionContext<any>, ...args: any[]) => Promise<any>;
|
15
|
-
type CommFunc = (ctxt:
|
16
|
+
type CommFunc = (ctxt: StepContext, ...args: any[]) => Promise<any>;
|
16
17
|
type ProcFunc = (ctxt: StoredProcedureContext, ...args: any[]) => Promise<any>;
|
17
18
|
export type WFInvokeFuncs<T> = T extends ConfiguredInstance ? never : {
|
18
19
|
[P in keyof T as T[P] extends TxFunc | CommFunc | ProcFunc ? P : never]: T[P] extends TxFunc | CommFunc | ProcFunc ? (...args: TailParameters<T[P]>) => ReturnType<T[P]> : never;
|
@@ -25,6 +26,8 @@ export interface WorkflowParams {
|
|
25
26
|
parentCtx?: DBOSContextImpl;
|
26
27
|
configuredInstance?: ConfiguredInstance | null;
|
27
28
|
recovery?: boolean;
|
29
|
+
queueName?: string;
|
30
|
+
executeWorkflow?: boolean;
|
28
31
|
}
|
29
32
|
export interface WorkflowConfig {
|
30
33
|
maxRecoveryAttempts?: number;
|
@@ -34,6 +37,7 @@ export interface WorkflowStatus {
|
|
34
37
|
readonly workflowName: string;
|
35
38
|
readonly workflowClassName: string;
|
36
39
|
readonly workflowConfigName: string;
|
40
|
+
readonly queueName?: string;
|
37
41
|
readonly authenticatedUser: string;
|
38
42
|
readonly assumedRole: string;
|
39
43
|
readonly authenticatedRoles: string[];
|
@@ -44,7 +48,7 @@ export interface GetWorkflowsInput {
|
|
44
48
|
authenticatedUser?: string;
|
45
49
|
startTime?: string;
|
46
50
|
endTime?: string;
|
47
|
-
status?: "PENDING" | "SUCCESS" | "ERROR" | "RETRIES_EXCEEDED" | "CANCELLED";
|
51
|
+
status?: "PENDING" | "SUCCESS" | "ERROR" | "RETRIES_EXCEEDED" | "CANCELLED" | "ENQUEUED";
|
48
52
|
applicationVersion?: string;
|
49
53
|
limit?: number;
|
50
54
|
}
|
@@ -65,6 +69,7 @@ export declare const StatusString: {
|
|
65
69
|
readonly ERROR: "ERROR";
|
66
70
|
readonly RETRIES_EXCEEDED: "RETRIES_EXCEEDED";
|
67
71
|
readonly CANCELLED: "CANCELLED";
|
72
|
+
readonly ENQUEUED: "ENQUEUED";
|
68
73
|
};
|
69
74
|
type WFFunc = (ctxt: WorkflowContext, ...args: any[]) => Promise<unknown>;
|
70
75
|
export type WfInvokeWfs<T> = {
|
@@ -90,8 +95,8 @@ export interface WorkflowContext extends DBOSContext {
|
|
90
95
|
childWorkflow<T extends unknown[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
|
91
96
|
invokeWorkflow<T extends ConfiguredInstance>(targetClass: T, workflowUUID?: string): WfInvokeWfsInst<T>;
|
92
97
|
invokeWorkflow<T extends object>(targetClass: T, workflowUUID?: string): WfInvokeWfs<T>;
|
93
|
-
startWorkflow<T extends ConfiguredInstance>(targetClass: T, workflowUUID?: string): WfInvokeWfsInstAsync<T>;
|
94
|
-
startWorkflow<T extends object>(targetClass: T, workflowUUID?: string): WfInvokeWfsAsync<T>;
|
98
|
+
startWorkflow<T extends ConfiguredInstance>(targetClass: T, workflowUUID?: string, queue?: WorkflowQueue): WfInvokeWfsInstAsync<T>;
|
99
|
+
startWorkflow<T extends object>(targetClass: T, workflowUUID?: string, queue?: WorkflowQueue): WfInvokeWfsAsync<T>;
|
95
100
|
send<T>(destinationUUID: string, message: T, topic?: string): Promise<void>;
|
96
101
|
recv<T>(topic?: string, timeoutSeconds?: number): Promise<T | null>;
|
97
102
|
setEvent<T>(key: string, value: T): Promise<void>;
|
@@ -135,8 +140,8 @@ export declare class WorkflowContextImpl extends DBOSContextImpl implements Work
|
|
135
140
|
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
136
141
|
* to use WorkflowContext.Transaction(OpClass.someMethod, param);
|
137
142
|
*/
|
138
|
-
proxyInvokeWF<T extends object>(object: T, workflowUUID: string | undefined, asyncWf: boolean, configuredInstance: ConfiguredInstance | null): WfInvokeWfsAsync<T>;
|
139
|
-
startWorkflow<T extends object>(target: T, workflowUUID?: string): WfInvokeWfsAsync<T>;
|
143
|
+
proxyInvokeWF<T extends object>(object: T, workflowUUID: string | undefined, asyncWf: boolean, configuredInstance: ConfiguredInstance | null, queue?: WorkflowQueue): WfInvokeWfsAsync<T>;
|
144
|
+
startWorkflow<T extends object>(target: T, workflowUUID?: string, queue?: WorkflowQueue): WfInvokeWfsAsync<T>;
|
140
145
|
invokeWorkflow<T extends object>(target: T, workflowUUID?: string): WfInvokeWfs<T>;
|
141
146
|
childWorkflow<T extends unknown[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
|
142
147
|
procedure<R>(proc: StoredProcedure<R>, ...args: unknown[]): Promise<R>;
|
@@ -148,11 +153,11 @@ export declare class WorkflowContextImpl extends DBOSContextImpl implements Work
|
|
148
153
|
*/
|
149
154
|
transaction<T extends unknown[], R>(txn: Transaction<T, R>, clsinst: ConfiguredInstance | null, ...args: T): Promise<R>;
|
150
155
|
/**
|
151
|
-
* Execute a
|
156
|
+
* Execute a step function.
|
152
157
|
* If it encounters any error, retry according to its configured retry policy until the maximum number of attempts is reached, then throw an DBOSError.
|
153
|
-
* The
|
158
|
+
* The step may execute many times, but once it is complete, it will not re-execute.
|
154
159
|
*/
|
155
|
-
external<T extends unknown[], R>(
|
160
|
+
external<T extends unknown[], R>(stepFn: StepFunction<T, R>, clsInst: ConfiguredInstance | null, ...args: T): Promise<R>;
|
156
161
|
/**
|
157
162
|
* Send a message to a workflow identified by a UUID.
|
158
163
|
* The message can optionally be tagged with a topic.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAkB,WAAW,EAAE,kBAAkB,EAA0B,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAA2B,MAAM,gBAAgB,CAAC;AAI5F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAA4B,MAAM,iBAAiB,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAA2B,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAyB,sBAAsB,EAA8B,MAAM,aAAa,CAAC;AACzH,OAAO,EAAE,eAAe,EA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,CAAC,CAAC,CAAC;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;IACrJ,QAAQ,CAAC,UAAU,CAAC;IAAU,QAAQ,CAAC,gBAAgB,CAAC;gBADrC,cAAc,EAAE,cAAc,EAAW,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,EAAW,YAAY,EAAE,MAAM,EAAW,YAAY,EAAE,MAAM,EAC5I,UAAU,CAAC,oBAAQ,EAAW,gBAAgB,CAAC,oBAAQ;IAElE,eAAe,IAAI,MAAM;IAInB,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAI3C,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC;IAIvB,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC;CAGvD;AAED;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,cAAc,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,cAAc;IAAE,QAAQ,CAAC,YAAY,EAAE,MAAM;IAAE,QAAQ,CAAC,UAAU,CAAC;IAAU,QAAQ,CAAC,gBAAgB,CAAC;gBAAvH,cAAc,EAAE,cAAc,EAAW,YAAY,EAAE,MAAM,EAAW,UAAU,CAAC,oBAAQ,EAAW,gBAAgB,CAAC,oBAAQ;IAEpJ,eAAe,IAAI,MAAM;IAInB,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAI3C,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC;IAIvB,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC;CAGvD"}
|
package/dist/src/workflow.js
CHANGED
@@ -4,7 +4,7 @@ exports.RetrievedHandle = exports.InvokedHandle = exports.WorkflowContextImpl =
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
5
5
|
const dbos_executor_1 = require("./dbos-executor");
|
6
6
|
const transaction_1 = require("./transaction");
|
7
|
-
const
|
7
|
+
const step_1 = require("./step");
|
8
8
|
const error_1 = require("./error");
|
9
9
|
const serialize_error_1 = require("serialize-error");
|
10
10
|
const utils_1 = require("./utils");
|
@@ -19,6 +19,7 @@ exports.StatusString = {
|
|
19
19
|
ERROR: "ERROR",
|
20
20
|
RETRIES_EXCEEDED: "RETRIES_EXCEEDED",
|
21
21
|
CANCELLED: "CANCELLED",
|
22
|
+
ENQUEUED: "ENQUEUED",
|
22
23
|
};
|
23
24
|
class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
24
25
|
workflowConfig;
|
@@ -228,12 +229,12 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
228
229
|
* Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
|
229
230
|
* to use WorkflowContext.Transaction(OpClass.someMethod, param);
|
230
231
|
*/
|
231
|
-
proxyInvokeWF(object, workflowUUID, asyncWf, configuredInstance) {
|
232
|
+
proxyInvokeWF(object, workflowUUID, asyncWf, configuredInstance, queue) {
|
232
233
|
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
233
234
|
const proxy = {};
|
234
235
|
const funcId = this.functionIDGetIncrement();
|
235
236
|
const childUUID = workflowUUID || (this.workflowUUID + "-" + funcId);
|
236
|
-
const params = { workflowUUID: childUUID, parentCtx: this, configuredInstance };
|
237
|
+
const params = { workflowUUID: childUUID, parentCtx: this, configuredInstance, queueName: queue?.name };
|
237
238
|
for (const op of ops) {
|
238
239
|
if (asyncWf) {
|
239
240
|
proxy[op.name] = op.workflowConfig
|
@@ -249,12 +250,12 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
249
250
|
}
|
250
251
|
return proxy;
|
251
252
|
}
|
252
|
-
startWorkflow(target, workflowUUID) {
|
253
|
+
startWorkflow(target, workflowUUID, queue) {
|
253
254
|
if (typeof target === 'function') {
|
254
|
-
return this.proxyInvokeWF(target, workflowUUID, true, null);
|
255
|
+
return this.proxyInvokeWF(target, workflowUUID, true, null, queue);
|
255
256
|
}
|
256
257
|
else {
|
257
|
-
return this.proxyInvokeWF(target, workflowUUID, true, target);
|
258
|
+
return this.proxyInvokeWF(target, workflowUUID, true, target, queue);
|
258
259
|
}
|
259
260
|
}
|
260
261
|
invokeWorkflow(target, workflowUUID) {
|
@@ -525,18 +526,18 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
525
526
|
}
|
526
527
|
}
|
527
528
|
/**
|
528
|
-
* Execute a
|
529
|
+
* Execute a step function.
|
529
530
|
* If it encounters any error, retry according to its configured retry policy until the maximum number of attempts is reached, then throw an DBOSError.
|
530
|
-
* The
|
531
|
+
* The step may execute many times, but once it is complete, it will not re-execute.
|
531
532
|
*/
|
532
|
-
async external(
|
533
|
-
const commInfo = this.#dbosExec.
|
533
|
+
async external(stepFn, clsInst, ...args) {
|
534
|
+
const commInfo = this.#dbosExec.getStepInfo(stepFn);
|
534
535
|
if (commInfo === undefined) {
|
535
|
-
throw new error_1.DBOSNotRegisteredError(
|
536
|
+
throw new error_1.DBOSNotRegisteredError(stepFn.name);
|
536
537
|
}
|
537
538
|
const funcID = this.functionIDGetIncrement();
|
538
539
|
const maxRetryIntervalSec = 3600; // Maximum retry interval: 1 hour
|
539
|
-
const span = this.#dbosExec.tracer.startSpan(
|
540
|
+
const span = this.#dbosExec.tracer.startSpan(stepFn.name, {
|
540
541
|
operationUUID: this.workflowUUID,
|
541
542
|
operationType: dbos_executor_1.OperationType.COMMUNICATOR,
|
542
543
|
authenticatedUser: this.authenticatedUser,
|
@@ -547,7 +548,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
547
548
|
maxAttempts: commInfo.config.maxAttempts,
|
548
549
|
backoffRate: commInfo.config.backoffRate,
|
549
550
|
}, this.span);
|
550
|
-
const ctxt = new
|
551
|
+
const ctxt = new step_1.StepContextImpl(this, funcID, span, this.#dbosExec.logger, commInfo.config, stepFn.name);
|
551
552
|
await this.#dbosExec.userDatabase.transaction(async (client) => {
|
552
553
|
await this.flushResultBuffer(client);
|
553
554
|
}, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
|
@@ -560,7 +561,7 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
560
561
|
this.#dbosExec.tracer.endSpan(ctxt.span);
|
561
562
|
return check;
|
562
563
|
}
|
563
|
-
// Execute the
|
564
|
+
// Execute the step function. If it throws an exception, retry with exponential backoff.
|
564
565
|
// After reaching the maximum number of retries, throw an DBOSError.
|
565
566
|
let result = dbos_executor_1.dbosNull;
|
566
567
|
let err = dbos_executor_1.dbosNull;
|
@@ -568,16 +569,16 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
568
569
|
let numAttempts = 0;
|
569
570
|
let intervalSeconds = ctxt.intervalSeconds;
|
570
571
|
if (intervalSeconds > maxRetryIntervalSec) {
|
571
|
-
this.logger.warn(`
|
572
|
+
this.logger.warn(`Step config interval exceeds maximum allowed interval, capped to ${maxRetryIntervalSec} seconds!`);
|
572
573
|
}
|
573
574
|
while (result === dbos_executor_1.dbosNull && numAttempts++ < ctxt.maxAttempts) {
|
574
575
|
try {
|
575
|
-
result = await
|
576
|
+
result = await stepFn.call(clsInst, ctxt, ...args);
|
576
577
|
}
|
577
578
|
catch (error) {
|
578
579
|
const e = error;
|
579
|
-
this.logger.warn(`
|
580
|
-
span.addEvent(`
|
580
|
+
this.logger.warn(`Error in step being automatically retried. Attempt ${numAttempts} of ${ctxt.maxAttempts}. ${e.stack}`);
|
581
|
+
span.addEvent(`Step attempt ${numAttempts + 1} failed`, { "retryIntervalSeconds": intervalSeconds, "error": error.message }, performance.now());
|
581
582
|
if (numAttempts < ctxt.maxAttempts) {
|
582
583
|
// Sleep for an interval, then increase the interval by backoffRate.
|
583
584
|
// Cap at the maximum allowed retry interval.
|
@@ -590,16 +591,16 @@ class WorkflowContextImpl extends context_1.DBOSContextImpl {
|
|
590
591
|
}
|
591
592
|
else {
|
592
593
|
try {
|
593
|
-
result = await
|
594
|
+
result = await stepFn.call(clsInst, ctxt, ...args);
|
594
595
|
}
|
595
596
|
catch (error) {
|
596
597
|
err = error;
|
597
598
|
}
|
598
599
|
}
|
599
|
-
// `result` can only be dbosNull when the
|
600
|
+
// `result` can only be dbosNull when the step timed out
|
600
601
|
if (result === dbos_executor_1.dbosNull) {
|
601
602
|
// Record the error, then throw it.
|
602
|
-
err = err === dbos_executor_1.dbosNull ? new error_1.DBOSError("
|
603
|
+
err = err === dbos_executor_1.dbosNull ? new error_1.DBOSError("Step reached maximum retries.", 1) : err;
|
603
604
|
await this.#dbosExec.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
|
604
605
|
ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: err.message });
|
605
606
|
this.#dbosExec.tracer.endSpan(ctxt.span);
|