@siglo/bullmq 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  When executing distributed workflows across worker clusters, BullMQ distributes asynchronous jobs backed by Redis. The `@siglo/bullmq` adapter wraps workflow execution within a standard BullMQ worker processor function (`(job: Job) => Promise<any>`).
10
10
 
11
+ > **Note on Guarantees**: Processing operates with at-least-once delivery semantics. On job delivery, the entire workflow executes from the beginning; it does not automatically resume at the last completed step. Claims and cached results do not make external side-effects atomic with job completion. A worker crash after an external effect (e.g., charge or API call) but before claim completion leaves an in-progress claim until TTL expiry, which can repeat the external effect on retry. Workflows must ensure external effects are idempotent or supply provider-level deduplication keys.
12
+
11
13
  ```mermaid
12
14
  flowchart TD
13
15
  Queue["Redis Queue (BullMQ)"] -->|Job Polling| Worker["BullMQ Worker"]
@@ -61,8 +63,8 @@ function createBullMQProcessor<TInput = any, TOutput = any, TJob = any>(
61
63
  | :--- | :--- | :--- | :--- |
62
64
  | `input` | `(job: TJob) => Promise<TInput> \| TInput` | `(job) => job.data` | Custom mapper to transform the BullMQ `Job` into workflow inputs. |
63
65
  | `output` | `(result: any, job: TJob) => Promise<TOutput> \| TOutput` | `(result) => result` | Custom mapper to format or filter the workflow result before returning to BullMQ. |
64
- | `idempotencyStore` | `IdempotencyStore` | `undefined` | Distributed store (e.g., `RedisIdempotencyStore` or `PostgresIdempotencyStore`) to guarantee exactly-once processing. |
65
- | `idempotencyTtlMs` | `number` | `86400000` (24h) | Time-to-live for the idempotency claim in milliseconds. |
66
+ | `idempotencyStore` | `IdempotencyStore` | `undefined` | Distributed store (e.g., `RedisIdempotencyStore` or `PostgresIdempotencyStore`) to provide distributed deduplication and claim locking. |
67
+ | `idempotencyTtlMs` | `number` | `undefined` | Time-to-live for the idempotency claim in milliseconds. Passed through to store (Redis/Postgres default: 24h; InMemory has no default expiration unless specified). |
66
68
  | `timeout` | `number` | `undefined` | SLA deadline in milliseconds for workflow execution. Throws `StepTimeoutException` / `FlowTimeoutException` if exceeded. |
67
69
  | `namespace` | `string \| ((job: TJob) => string \| undefined)` | `job.data?.namespace` | Target namespace for state partitioning and checkpoint isolation. |
68
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siglo/bullmq",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "BullMQ job queue consumer and worker adapter for Siglo workflows",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",