@dudousxd/nestjs-durable 0.46.1 → 0.46.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudousxd/nestjs-durable",
3
- "version": "0.46.1",
3
+ "version": "0.46.3",
4
4
  "description": "Durable workflows for NestJS — module, decorators, discovery and boot recovery",
5
5
  "license": "MIT",
6
6
  "author": "Davide Carvalho",
@@ -68,9 +68,9 @@
68
68
  "@dudousxd/nestjs-diagnostics": "0.5.0",
69
69
  "@tanstack/intent": "0.4.0",
70
70
  "@dudousxd/durable-worker": "0.10.3",
71
- "@dudousxd/nestjs-durable-core": "^0.75.0",
71
+ "@dudousxd/nestjs-durable-core": "^0.77.0",
72
72
  "@dudousxd/nestjs-durable-dashboard": "0.49.0",
73
- "@dudousxd/nestjs-durable-transport-bullmq": "0.21.2",
73
+ "@dudousxd/nestjs-durable-transport-bullmq": "0.22.0",
74
74
  "@dudousxd/nestjs-durable-transport-event-emitter": "^0.5.1"
75
75
  },
76
76
  "module": "./dist/index.js",
@@ -137,6 +137,18 @@ const [a, b] = await Promise.all([
137
137
  ]);
138
138
  ```
139
139
 
140
+ For the same step over many inputs, use `ctx.all` with the `@Step` reference. It dispatches one step
141
+ per input, wakes the workflow once per settled wave instead of once per result, and returns the
142
+ outputs in input order (a `GatherError` carries the failed indexes, as for a child fan):
143
+
144
+ ```ts
145
+ const results = await ctx.all(this.lines.processLine, lines, { concurrency: 500 });
146
+ ```
147
+
148
+ Prefer it to `Promise.all` past a handful of steps: every result of a `Promise.all` replays the
149
+ workflow, which makes a fan of N steps cost O(N²) checkpoint reads. Prefer it to a child-workflow
150
+ `ctx.all` when each item is just a step: a child costs a whole run (row, turn, lease, signal).
151
+
140
152
  ### Sub-process events inside a step
141
153
 
142
154
  For pure visibility *inside* one step's execution, the `@Step` handler's optional second argument