@dudousxd/nestjs-durable-core 0.40.0 → 0.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -574,6 +574,15 @@ interface SignalWaiter {
|
|
|
574
574
|
token: string;
|
|
575
575
|
runId: string;
|
|
576
576
|
seq: number;
|
|
577
|
+
/**
|
|
578
|
+
* The parallel-fan group this waiter belongs to, carried from the awaiting command so the resolving
|
|
579
|
+
* `signal:<token>` checkpoint (notably `signal:child:<id>` for an awaited child run) can be tagged
|
|
580
|
+
* with it. A worker's `ctx.gather_children`/`ctx.all` fan-out stamps every `startChild` with the same
|
|
581
|
+
* group; without threading it through the waiter, the child-await checkpoint comes out untagged and the
|
|
582
|
+
* dashboard renders the fan as a sequential chain instead of one parallel group. Undefined for an
|
|
583
|
+
* ordinary (non-fan) signal/child await.
|
|
584
|
+
*/
|
|
585
|
+
parallelGroup?: string | undefined;
|
|
577
586
|
}
|
|
578
587
|
/** A unit of work dispatched to a remote worker. This is the documented wire payload. */
|
|
579
588
|
interface RemoteTask {
|
package/dist/index.d.ts
CHANGED
|
@@ -574,6 +574,15 @@ interface SignalWaiter {
|
|
|
574
574
|
token: string;
|
|
575
575
|
runId: string;
|
|
576
576
|
seq: number;
|
|
577
|
+
/**
|
|
578
|
+
* The parallel-fan group this waiter belongs to, carried from the awaiting command so the resolving
|
|
579
|
+
* `signal:<token>` checkpoint (notably `signal:child:<id>` for an awaited child run) can be tagged
|
|
580
|
+
* with it. A worker's `ctx.gather_children`/`ctx.all` fan-out stamps every `startChild` with the same
|
|
581
|
+
* group; without threading it through the waiter, the child-await checkpoint comes out untagged and the
|
|
582
|
+
* dashboard renders the fan as a sequential chain instead of one parallel group. Undefined for an
|
|
583
|
+
* ordinary (non-fan) signal/child await.
|
|
584
|
+
*/
|
|
585
|
+
parallelGroup?: string | undefined;
|
|
577
586
|
}
|
|
578
587
|
/** A unit of work dispatched to a remote worker. This is the documented wire payload. */
|
|
579
588
|
interface RemoteTask {
|
package/dist/index.js
CHANGED
|
@@ -1208,7 +1208,8 @@ function createWorkflowCtx(host, runId, compensations, workflow = "") {
|
|
|
1208
1208
|
await store.putSignalWaiter({
|
|
1209
1209
|
token: `child:${childId}`,
|
|
1210
1210
|
runId,
|
|
1211
|
-
seq
|
|
1211
|
+
seq,
|
|
1212
|
+
parallelGroup: group
|
|
1212
1213
|
});
|
|
1213
1214
|
if (!await store.getRun(childId)) host.startChild(name, inputs[i], childId);
|
|
1214
1215
|
if (!cp) {
|
|
@@ -2283,7 +2284,12 @@ var WorkflowEngine = class {
|
|
|
2283
2284
|
seq: waiter.seq,
|
|
2284
2285
|
name: `signal:${token}`,
|
|
2285
2286
|
kind: "signal",
|
|
2286
|
-
output: payload
|
|
2287
|
+
output: payload,
|
|
2288
|
+
// Carry the awaiting command's fan group (set when a `ctx.gather_children`/`ctx.all` fan-out
|
|
2289
|
+
// registered this waiter) onto the resolving `signal:child:<id>` checkpoint, so the dashboard
|
|
2290
|
+
// groups the child fan-out vertically instead of rendering it as a sequential chain. Undefined
|
|
2291
|
+
// for an ordinary (non-fan) signal/child await.
|
|
2292
|
+
parallelGroup: waiter.parallelGroup
|
|
2287
2293
|
}));
|
|
2288
2294
|
return this.resume(waiter.runId).catch((err) => {
|
|
2289
2295
|
if (err instanceof NamespaceMismatch) return null;
|
|
@@ -3053,7 +3059,12 @@ var WorkflowEngine = class {
|
|
|
3053
3059
|
await this.store.putSignalWaiter({
|
|
3054
3060
|
token: `child:${childId}`,
|
|
3055
3061
|
runId: run.id,
|
|
3056
|
-
seq: cmd.seq
|
|
3062
|
+
seq: cmd.seq,
|
|
3063
|
+
// A `ctx.gather_children`/`ctx.all` fan-out stamps every `startChild` in the fan with the same
|
|
3064
|
+
// group. Thread it onto the waiter so the child's terminal `signal:child:<id>` checkpoint
|
|
3065
|
+
// (written by engine.signal when the child notifies the parent) carries the group and the
|
|
3066
|
+
// dashboard renders the fan as one parallel group. Undefined for a lone (non-fan) child.
|
|
3067
|
+
parallelGroup: cmd.parallelGroup
|
|
3057
3068
|
});
|
|
3058
3069
|
if (!await this.store.getRun(childId)) {
|
|
3059
3070
|
queueMicrotask(() => void this.start(cmd.workflow, cmd.input, childId).catch(() => void 0));
|