@workflow/world-postgres 5.1.1 → 5.2.0

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/queue.d.ts CHANGED
@@ -18,14 +18,15 @@ export declare function serializeGraphileMeta(meta: unknown): string;
18
18
  * done, and a bound here declares a slow-but-healthy delivery crashed and
19
19
  * redelivers it while the original is still running (two executions of the
20
20
  * same steps). Crash recovery does not need one: `reenqueueActiveRuns`
21
- * re-enqueues active runs on start, and with `jobLockStaleSeconds` set a
22
- * running delivery renews its job lock and any other process releases a job
23
- * whose lock goes unrenewed (because its process died), and the lock of its
24
- * named queue, for redelivery (see `job-lease.ts`). Without it, Graphile
25
- * Worker resets a dead worker's job and named-queue locks only after 4 hours
26
- * (`resetLockedAt`). A spec 9 run's orchestrator deliveries all use the run's
27
- * named queue, so without it a hard-killed worker can hold them back for that
28
- * long; see the README.
21
+ * re-enqueues active runs on start, and a running delivery renews its job
22
+ * lock while any other process releases a job whose lock goes unrenewed
23
+ * (because its process died), and the lock of its named queue, for
24
+ * redelivery (see `job-lease.ts`). By default that release covers only the
25
+ * per-run named queues (a spec 9 run's orchestrator deliveries, invoke mode's
26
+ * executor lane) of renewing holders, after 300 seconds; with
27
+ * `jobLockStaleSeconds` set it covers every job of this World after that
28
+ * window, and `0` turns it off, leaving Graphile Worker's 4 hour reset
29
+ * (`resetLockedAt`).
29
30
  */
30
31
  export declare const DEFAULT_DELIVERY_HEADERS_TIMEOUT_MS = 0;
31
32
  export declare const DEFAULT_DELIVERY_BODY_TIMEOUT_MS = 0;
@@ -39,6 +40,13 @@ export declare function getDeliveryTimeouts(): {
39
40
  headersTimeoutMs: number;
40
41
  bodyTimeoutMs: number;
41
42
  };
43
+ /**
44
+ * Re-runs of one spec 9 orchestrator delivery for the run's orchestrator
45
+ * messages that queued behind it (see `takeCoalescedJobs`), as world-vercel
46
+ * bounds its coalesced re-runs. Past the cap the delivery acknowledges, and
47
+ * the messages still waiting are delivered as usual.
48
+ */
49
+ export declare const MAX_COALESCED_RERUNS = 32;
42
50
  /**
43
51
  * Process workflow and step jobs, with optional run-scoped execution queues for invoke().
44
52
  */
@@ -50,5 +58,10 @@ export type PostgresQueue = Queue & {
50
58
  /** Deliver a queue prefix's messages over HTTP to `path` on the app (see `Queue.registerRoute`). */
51
59
  registerRoute(prefix: QueuePrefix, path: string): void;
52
60
  };
53
- export declare function createQueue(config: PostgresWorldConfig, pool: Pool): PostgresQueue;
61
+ export declare function createQueue(config: PostgresWorldConfig, pool: Pool,
62
+ /** @internal Test hooks; not part of the public API. */
63
+ internal?: {
64
+ /** The `'named-queues'` default window, in place of 300 seconds. */
65
+ defaultJobLockStaleSeconds?: number;
66
+ }): PostgresQueue;
54
67
  //# sourceMappingURL=queue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAgBA,OAAO,EAOL,KAAK,KAAK,EAEV,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AAczB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAG/B,OAAO,EAAE,KAAK,mBAAmB,EAAoB,MAAM,aAAa,CAAC;AAMzE;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAsB3D;AAsBD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC;AACrD,eAAO,MAAM,gCAAgC,IAAI,CAAC;AASlD;;;;;GAKG;AACH,wBAAgB,mBAAmB;;;EAWlC;AA+DD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAClC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,oGAAoG;IACpG,eAAe,CACb,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,CAAC,GAAG,EAA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