@adonis-agora/durable 0.53.0 → 0.54.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/CHANGELOG.md +25 -0
- package/dist/src/buffered-child-signals.d.ts +46 -0
- package/dist/src/buffered-child-signals.d.ts.map +1 -0
- package/dist/src/buffered-child-signals.js +293 -0
- package/dist/src/buffered-child-signals.js.map +1 -0
- package/dist/src/codec-state-store.d.ts +9 -1
- package/dist/src/codec-state-store.d.ts.map +1 -1
- package/dist/src/codec-state-store.js +26 -0
- package/dist/src/codec-state-store.js.map +1 -1
- package/dist/src/commands/worker.d.ts +2 -1
- package/dist/src/commands/worker.d.ts.map +1 -1
- package/dist/src/commands/worker.js +44 -0
- package/dist/src/commands/worker.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/engine.d.ts +63 -1
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +326 -56
- package/dist/src/engine.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/interfaces.d.ts +38 -0
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/interfaces.js.map +1 -1
- package/dist/src/stores/lucid.d.ts +5 -1
- package/dist/src/stores/lucid.d.ts.map +1 -1
- package/dist/src/stores/lucid.js +111 -5
- package/dist/src/stores/lucid.js.map +1 -1
- package/dist/src/testing/in-memory-state-store.d.ts +5 -1
- package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
- package/dist/src/testing/in-memory-state-store.js +42 -3
- package/dist/src/testing/in-memory-state-store.js.map +1 -1
- package/dist/src/testing-kit/run-dispatch-contract.d.ts.map +1 -1
- package/dist/src/testing-kit/run-dispatch-contract.js +98 -0
- package/dist/src/testing-kit/run-dispatch-contract.js.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.d.ts +6 -0
- package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
- package/dist/src/testing-kit/state-store-conformance.js +189 -0
- package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
- package/dist/src/transport-pool.d.ts +7 -0
- package/dist/src/transport-pool.d.ts.map +1 -1
- package/dist/src/transport-pool.js +28 -0
- package/dist/src/transport-pool.js.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.d.ts +10 -4
- package/dist/src/transports/bullmq/bullmq-transport.d.ts.map +1 -1
- package/dist/src/transports/bullmq/bullmq-transport.js +44 -1
- package/dist/src/transports/bullmq/bullmq-transport.js.map +1 -1
- package/dist/src/transports/db.d.ts +9 -1
- package/dist/src/transports/db.d.ts.map +1 -1
- package/dist/src/transports/db.js +106 -36
- package/dist/src/transports/db.js.map +1 -1
- package/dist/src/transports/queue.d.ts +9 -1
- package/dist/src/transports/queue.d.ts.map +1 -1
- package/dist/src/transports/queue.js +28 -1
- package/dist/src/transports/queue.js.map +1 -1
- package/package.json +3 -3
- package/skills/durable-transports-stores/SKILL.md +11 -10
|
@@ -81,7 +81,7 @@ transport.handle('pipeline:extract', async (input) => extract(input))
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
A worker runs ONE task row at a time unless `concurrency` is raised
|
|
84
|
-
(`transports.db({ concurrency: 8, resultConcurrency:
|
|
84
|
+
(`transports.db({ concurrency: 8, resultConcurrency: 1024 })`, or `'adaptive'` with
|
|
85
85
|
the same controller and fields as `queue`/`bullmq`); one poll loop serves every
|
|
86
86
|
handler name and claims only as many rows as it has free slots. Every held
|
|
87
87
|
claim is renewed every `leaseMs / 3`, and a row is recorded (task delete +
|
|
@@ -150,7 +150,7 @@ export default defineConfig({
|
|
|
150
150
|
One instance consumes engine-side results; run one or more `node ace
|
|
151
151
|
durable:work` workers serving the step names. A worker runs ONE job of a step
|
|
152
152
|
name at a time unless `concurrency` is raised (`transports.queue({ connection,
|
|
153
|
-
concurrency: 8, resultConcurrency:
|
|
153
|
+
concurrency: 8, resultConcurrency: 1024 })`); the slots share one poll loop.
|
|
154
154
|
`concurrency: 'adaptive'` (or `{ mode: 'adaptive', min, max, start, tickMs,
|
|
155
155
|
ramCeilingPct, cpuCeilingPct }`) runs the same controller as `bullmq` (below);
|
|
156
156
|
each step name's loop reads the live limit every poll. Idle
|
|
@@ -177,10 +177,10 @@ on `<prefix>:inbox-registrations`, recorded in the control plane's key store;
|
|
|
177
177
|
tune with `inboxTtlMs`, `tenantSubscribersCacheMs`, `inboxSweepIntervalMs`).
|
|
178
178
|
See `durable-cluster`.
|
|
179
179
|
|
|
180
|
-
For wide fans (`ctx.all` over thousands of steps),
|
|
181
|
-
|
|
182
|
-
let its workers size their step
|
|
183
|
-
batch:
|
|
180
|
+
For wide fans (`ctx.all` over thousands of steps), the `bullmq`, `queue` and
|
|
181
|
+
`db` transports hand the engine at least 512 step results at once per instance
|
|
182
|
+
(`resultConcurrency` only raises it), let its workers size their step
|
|
183
|
+
concurrency, and size the engine's due-timer batch:
|
|
184
184
|
|
|
185
185
|
```ts title="config/durable.ts"
|
|
186
186
|
export default defineConfig({
|
|
@@ -188,7 +188,7 @@ export default defineConfig({
|
|
|
188
188
|
transports: {
|
|
189
189
|
bullmq: transports.bullmq({
|
|
190
190
|
connection: { host: '127.0.0.1', port: 6379 }, // or 'redis://…' / 'rediss://…' (0.50+)
|
|
191
|
-
resultConcurrency:
|
|
191
|
+
resultConcurrency: 2048, // more results in hand at once (at least 512 held)
|
|
192
192
|
// A number pins each task queue's concurrency (default 1). 'adaptive' moves it
|
|
193
193
|
// every tickMs: +1 while steps saturate the limit at steady latency, down by the
|
|
194
194
|
// latency gradient when they queue, -1 on >20% errors / a stall / the CPU ceiling,
|
|
@@ -203,7 +203,7 @@ Only step durations feed the adaptive window (workflow turns count as in-flight
|
|
|
203
203
|
work and progress); a non-finite or out-of-range field falls back to its default, and
|
|
204
204
|
`cpuCeilingPct` is off unless set. A number runs no control loop. The heartbeat's
|
|
205
205
|
throughput covers the trailing minute, decaying while the worker is idle and reading 0 once a minute passes with no completed step; with a fixed limit the heartbeat still reports `cpuPct`, sampled at most once every 2s. In adaptive mode the decisions, step-events, start-run and run-request consumers run
|
|
206
|
-
at 1 (results run at `resultConcurrency`). Sources: `docs/transports/index.mdx`, `docs/cluster/interop.mdx`.
|
|
206
|
+
at 1 (results run at at least 512, `resultConcurrency` when higher). Sources: `docs/transports/index.mdx`, `docs/cluster/interop.mdx`.
|
|
207
207
|
|
|
208
208
|
Two `bullmq` safety nets: `pingIntervalMs` (default 30s; `0`/`false` off) PINGs
|
|
209
209
|
every pub/sub subscriber (heartbeats, run replies, tenant events) and reconnects
|
|
@@ -291,8 +291,9 @@ export default defineConfig({
|
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
A custom store should implement `countCheckpoints(runId, fromSeq, toSeq,
|
|
294
|
-
statuses)` as a `COUNT` (the step-fan join barrier
|
|
295
|
-
|
|
294
|
+
statuses)` as a `COUNT` (the step-fan join barrier asks it once per fan per
|
|
295
|
+
batch, skipped while more of the same fan's results are queued behind the batch;
|
|
296
|
+
without it the engine loads the run's checkpoints to count), implement
|
|
296
297
|
`saveCheckpointIfPending` as one conditional `UPDATE ... WHERE status = 'pending'`
|
|
297
298
|
(without it a blind save can put a settled step back to `pending`), and return
|
|
298
299
|
`listDueTimers` most overdue first, with or without a `limit`. Run
|