@warlock.js/queue 5.34.1 → 5.34.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/CHANGELOG.md +12 -0
- package/llms-full.txt +46 -36
- package/llms.txt +6 -6
- package/package.json +3 -3
- package/skills/index.md +13 -2
- package/skills/overview/SKILL.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@warlock.js/queue` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
|
|
6
6
|
|
|
7
|
+
## 5.34.3 - 2026-10-20
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Condensed the package agent skill description to at most 450 characters, with API names and package routing guidance.
|
|
12
|
+
|
|
13
|
+
## 5.34.2 - 2026-10-19
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Merge package orientation into the grouped skill index and remove the duplicate overview topic; preserve that orientation in generated LLM projections.
|
|
18
|
+
|
|
7
19
|
## 5.34.0 - 2026-10-19
|
|
8
20
|
|
|
9
21
|
### Added
|
package/llms-full.txt
CHANGED
|
@@ -4,7 +4,48 @@
|
|
|
4
4
|
|
|
5
5
|
> Generated artifact. Concatenates every SKILL.md and reference file under `@warlock.js/queue/skills/`. Re-run `node scripts/generate-llms.mjs` after any change.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Package orientation
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
description: 'Background jobs with BullMQ/Redis, local SQLite or memory: `defineJob`, `queueConnector`, `startWorkers`, `closeQueue`, `failedJobs` and `mountQueueDashboard`. Use for "run in the background", "retry a job", "delay work", "survive restarts" or "view the job dashboard". Not this package → @warlock.js/scheduler for recurring schedules; @warlock.js/herald for pub/sub; @warlock.js/core for the in-memory `Queue` batcher.'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# @warlock.js/queue
|
|
14
|
+
|
|
15
|
+
Jobs are stored in Redis (default; not bundled), local SQLite without Redis, or memory for tests, retried on failure, and run by workers, in the app process by default. `defineJob({ name, handle })` registers a handler and returns a typed job; `job.dispatch(payload, options)` enqueues it. Any process with the same definition and a worker can run it. Server-only.
|
|
16
|
+
|
|
17
|
+
## The 80% path
|
|
18
|
+
|
|
19
|
+
1. Use this index for orientation and choose a task below.
|
|
20
|
+
2. Configure `src/config/queue.ts` and register `queueConnector()`: `configure-queue.md`.
|
|
21
|
+
3. Define and dispatch jobs (attempts, backoff, delay, priority, progress): `define-jobs.md`.
|
|
22
|
+
4. Inspect and recover failures, optionally the bull-board dashboard: `manage-failed-jobs.md`.
|
|
23
|
+
5. Back `@warlock.js/notifications` `.queue()` with BullMQ: `queue-notifications.md`.
|
|
24
|
+
|
|
25
|
+
## Conventions and pitfalls
|
|
26
|
+
|
|
27
|
+
- Job names are the routing key; a job with no matching `defineJob` in the worker process cannot run.
|
|
28
|
+
- Handlers must be idempotent: retries re-run them.
|
|
29
|
+
- Shutdown lets active jobs finish up to `workers.shutdownTimeout`, then closes connections.
|
|
30
|
+
- Guard the dashboard with middleware; an unguarded one is refused on purpose.
|
|
31
|
+
- Core `Queue` is an in-memory batcher, lost on exit; use this package when work must survive.
|
|
32
|
+
- Do not value-import from client code.
|
|
33
|
+
|
|
34
|
+
Use the `local-queues` topic for `driver: "local"` / `"memory"`, Node requirements, leases, crash recovery, and cancellation.
|
|
35
|
+
|
|
36
|
+
## Mental model
|
|
37
|
+
|
|
38
|
+
- **Job definition** — `defineJob({ name, handle })` registers a handler by name and returns a typed job.
|
|
39
|
+
- **Dispatch** — `job.dispatch(payload, options)` stores the job in the configured backend. Any process with the same definition and a worker can run it.
|
|
40
|
+
- **Worker** — one per queue name, started by `queueConnector()` (or `startWorkers()`); routes each job to the handler with its name.
|
|
41
|
+
- **Shutdown** — workers stop taking jobs, active jobs finish (up to `workers.shutdownTimeout`), then connections close.
|
|
42
|
+
|
|
43
|
+
## Not core's `Queue`
|
|
44
|
+
|
|
45
|
+
`@warlock.js/core` exports `Queue` — an in-memory batcher that flushes items by size or interval inside one process. No storage, no retries, lost on exit. Use `@warlock.js/queue` when work must survive a restart or be retried.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## configure-queue `@warlock.js/queue/skills/configure-queue/SKILL.md`
|
|
8
49
|
|
|
9
50
|
---
|
|
10
51
|
name: configure-queue
|
|
@@ -67,7 +108,7 @@ Every process must use the same `prefix`, or they will not see each other's jobs
|
|
|
67
108
|
`QueueConfig` also takes a `dashboard: { enabled, path, middleware }` block — see the "Dashboard (optional)" section of the `manage-failed-jobs` topic for the `warlock add bull-board` setup and the production guard (`QueueDashboardUnguardedError`).
|
|
68
109
|
|
|
69
110
|
|
|
70
|
-
## define-jobs `@warlock.js/queue/define-jobs/SKILL.md`
|
|
111
|
+
## define-jobs `@warlock.js/queue/skills/define-jobs/SKILL.md`
|
|
71
112
|
|
|
72
113
|
---
|
|
73
114
|
name: define-jobs
|
|
@@ -168,7 +209,7 @@ Jobs are not run — call the handler to test it. Opt out with `tests.fakes: { q
|
|
|
168
209
|
- Defining the same name again replaces the handler (this is what keeps dev reloads working), so keep names unique.
|
|
169
210
|
|
|
170
211
|
|
|
171
|
-
## local-queues `@warlock.js/queue/local-queues/SKILL.md`
|
|
212
|
+
## local-queues `@warlock.js/queue/skills/local-queues/SKILL.md`
|
|
172
213
|
|
|
173
214
|
---
|
|
174
215
|
name: local-queues
|
|
@@ -293,7 +334,7 @@ and process-role gating work for every backend.
|
|
|
293
334
|
with local/memory queues. Prefer BullMQ for multi-host/high-volume workloads.
|
|
294
335
|
|
|
295
336
|
|
|
296
|
-
## manage-failed-jobs `@warlock.js/queue/manage-failed-jobs/SKILL.md`
|
|
337
|
+
## manage-failed-jobs `@warlock.js/queue/skills/manage-failed-jobs/SKILL.md`
|
|
297
338
|
|
|
298
339
|
---
|
|
299
340
|
name: manage-failed-jobs
|
|
@@ -365,38 +406,7 @@ await queueDashboard(getHttpServer(), {
|
|
|
365
406
|
- It has no authentication of its own — pass `middleware` yourself; this path does not enforce the production guard that the `dashboard` config does.
|
|
366
407
|
|
|
367
408
|
|
|
368
|
-
##
|
|
369
|
-
|
|
370
|
-
---
|
|
371
|
-
name: overview
|
|
372
|
-
description: "@warlock.js/queue overview for orientation and choosing the focused skill for the task."
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
# `@warlock.js/queue` — overview
|
|
376
|
-
|
|
377
|
-
Durable background jobs. Jobs are stored in **Redis** (default), local SQLite without Redis, or memory for tests, retried on failure, and processed by workers — inside the app process by default.
|
|
378
|
-
|
|
379
|
-
## Mental model
|
|
380
|
-
|
|
381
|
-
- **Job definition** — `defineJob({ name, handle })` registers a handler by name and returns a typed job.
|
|
382
|
-
- **Dispatch** — `job.dispatch(payload, options)` stores the job in the configured backend. Any process with the same definition and a worker can run it.
|
|
383
|
-
- **Worker** — one per queue name, started by `queueConnector()` (or `startWorkers()`); routes each job to the handler with its name.
|
|
384
|
-
- **Shutdown** — workers stop taking jobs, active jobs finish (up to `workers.shutdownTimeout`), then connections close.
|
|
385
|
-
|
|
386
|
-
## Not core's `Queue`
|
|
387
|
-
|
|
388
|
-
`@warlock.js/core` exports `Queue` — an in-memory batcher that flushes items by size or interval inside one process. No storage, no retries, lost on exit. Use `@warlock.js/queue` when work must survive a restart or be retried.
|
|
389
|
-
|
|
390
|
-
## Skills index
|
|
391
|
-
|
|
392
|
-
- `local-queues` — SQLite/memory configuration, leases, crash recovery, cancellation.
|
|
393
|
-
- `configure-queue` — `src/config/queue.ts`, `queueConnector()`, workers on/off, shutdown.
|
|
394
|
-
- `define-jobs` — `defineJob`, `dispatch` options, retries, progress, `find`.
|
|
395
|
-
- `manage-failed-jobs` — `failedJobs`, `retryFailedJob`, the bull-board dashboard.
|
|
396
|
-
- `queue-notifications` — `bullmqQueue()` for notifications `.queue()`.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
## queue-notifications `@warlock.js/queue/queue-notifications/SKILL.md`
|
|
409
|
+
## queue-notifications `@warlock.js/queue/skills/queue-notifications/SKILL.md`
|
|
400
410
|
|
|
401
411
|
---
|
|
402
412
|
name: queue-notifications
|
package/llms.txt
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## Skills
|
|
8
8
|
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
12
|
-
- [
|
|
13
|
-
- [
|
|
14
|
-
- [queue-notifications](@warlock.js/queue/queue-notifications/SKILL.md): Send `@warlock.js/notifications` `.queue()` deliveries through BullMQ with `bullmqQueue({ queue?, attempts?, backoff? })` from `@warlock.js/notifications` — put it in the `queue` slot of `src/config/notifications.ts`; the queue workers deliver. Honours `SendOptions.delay` (number = seconds, or "10m"), retries a failing `channel.send`, and fails at once for a channel missing from the worker config. Triggers: `bullmqQueue`, `NotificationConfig.queue`, `QueuePackageNotInstalledError`; "queue notifications with BullMQ", "retry notification delivery", "delayed notification". Skip: the herald backend — the `queue-notifications` topic of the `warlock-js-notifications` skill.
|
|
9
|
+
- [Package orientation](@warlock.js/queue/skills/index.md): Background jobs with BullMQ/Redis, local SQLite or memory: `defineJob`, `queueConnector`, `startWorkers`, `closeQueue`, `failedJobs` and `mountQueueDashboard`. Use for "run in the background", "retry a job", "delay work", "survive restarts" or "view the job dashboard". Not this package → @warlock.js/scheduler for recurring schedules; @warlock.js/herald for pub/sub; @warlock.js/core for the in-memory `Queue` batcher.
|
|
10
|
+
- [configure-queue](@warlock.js/queue/skills/configure-queue/SKILL.md): Configure `@warlock.js/queue`: the declarative `src/config/queue.ts` (`QueueConfig` — `connection`, `prefix`, `defaultQueue`, `defaultJobOptions`, `workers: { enabled, concurrency, shutdownTimeout }`), registering `queueConnector()` in `warlock.config.ts > connectors`, running a dispatch-only process, and graceful shutdown. Programmatic `setQueueConfig` / `startWorkers` / `closeQueue` for scripts and tests. Triggers: `QueueConfig`, `queueConnector`, `setQueueConfig`, `startWorkers`, `closeQueue`, `workers.enabled`, `shutdownTimeout`; "configure the queue", "connect BullMQ to Redis", "disable workers in the web process", "graceful shutdown of jobs". Skip: writing jobs — the `define-jobs` topic.
|
|
11
|
+
- [define-jobs](@warlock.js/queue/skills/define-jobs/SKILL.md): Define and dispatch background jobs with `@warlock.js/queue`: `defineJob({ name, queue?, attempts?, backoff?, removeOnComplete?, removeOnFail?, handle(payload, ctx) })` returns a typed job; `job.dispatch(payload, { delay, priority, jobId, attempts, backoff })`; the handler context (`id`, `attempt`, `maxAttempts`, `progress()`, `log()`); reading a job with `job.find(id)`. Triggers: `setDispatchInterceptor`, `queueFake`, `defineJob`, `.dispatch(`, `ctx.progress`, `JobContext`, `DispatchOptions`, `backoff`, `attempts`, `priority`, `jobId`; "run this in the background", "retry with backoff", "delay a job", "job progress", "idempotent dispatch". Skip: config and workers — the `configure-queue` topic; failed jobs — the `manage-failed-jobs` topic.
|
|
12
|
+
- [local-queues](@warlock.js/queue/skills/local-queues/SKILL.md): Run @warlock.js/queue without Redis: driver: "local" for durable single-host SQLite jobs using node:sqlite on Node >= 22.15, or driver: "memory" for real handler execution in tests. Covers local.path, leases, crash recovery, polling, concurrency, cancellation, graceful shutdown, and at-least-once delivery. Use for local/desktop background jobs, testing workers without Redis, or configuring SQLite queues.
|
|
13
|
+
- [manage-failed-jobs](@warlock.js/queue/skills/manage-failed-jobs/SKILL.md): Inspect and retry failed `@warlock.js/queue` jobs: `failedJobs({ queue, start, end })` returns `FailedJob[]` (`id`, `name`, `payload`, `attemptsMade`, `failedReason`, `stacktrace`, `failedAt`, `retry()`), `retryFailedJob(id, { queue })` (throws `FailedJobNotFoundError`), and the bull-board UI — `warlock add bull-board` (requires: ["queue"], so it installs queue first when missing) writes a `dashboard: { enabled, path, middleware }` block to `src/config/queue.ts`; a guard middleware is required in production or boot throws `QueueDashboardUnguardedError`. Manual `queueDashboard(server, { basePath, queues, middleware })` also available — needs `@bull-board/api` + `@bull-board/fastify`, loaded only on call, missing ones throw `QueueDashboardDependencyError`. Triggers: `failedJobs`, `retryFailedJob`, `queueDashboard`, `bull-board`, `dashboard.enabled`, `QueueDashboardUnguardedError`; "list failed jobs", "retry a failed job", "queue dashboard", "job admin UI". Skip: defining retries — the `define-jobs` topic.
|
|
14
|
+
- [queue-notifications](@warlock.js/queue/skills/queue-notifications/SKILL.md): Send `@warlock.js/notifications` `.queue()` deliveries through BullMQ with `bullmqQueue({ queue?, attempts?, backoff? })` from `@warlock.js/notifications` — put it in the `queue` slot of `src/config/notifications.ts`; the queue workers deliver. Honours `SendOptions.delay` (number = seconds, or "10m"), retries a failing `channel.send`, and fails at once for a channel missing from the worker config. Triggers: `bullmqQueue`, `NotificationConfig.queue`, `QueuePackageNotInstalledError`; "queue notifications with BullMQ", "retry notification delivery", "delayed notification". Skip: the herald backend — the `queue-notifications` topic of the `warlock-js-notifications` skill.
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@bull-board/api": "^9.0.0",
|
|
13
13
|
"@bull-board/fastify": "^9.0.0",
|
|
14
|
-
"@warlock.js/core": "5.34.
|
|
15
|
-
"@warlock.js/logger": "5.34.
|
|
14
|
+
"@warlock.js/core": "5.34.3",
|
|
15
|
+
"@warlock.js/logger": "5.34.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"@bull-board/api": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"author": "hassanzohdy",
|
|
40
40
|
"license": "MIT",
|
|
41
|
-
"version": "5.34.
|
|
41
|
+
"version": "5.34.3",
|
|
42
42
|
"main": "./cjs/index.cjs",
|
|
43
43
|
"module": "./esm/index.mjs",
|
|
44
44
|
"types": "./esm/index.d.mts",
|
package/skills/index.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: 'Background jobs
|
|
2
|
+
description: 'Background jobs with BullMQ/Redis, local SQLite or memory: `defineJob`, `queueConnector`, `startWorkers`, `closeQueue`, `failedJobs` and `mountQueueDashboard`. Use for "run in the background", "retry a job", "delay work", "survive restarts" or "view the job dashboard". Not this package → @warlock.js/scheduler for recurring schedules; @warlock.js/herald for pub/sub; @warlock.js/core for the in-memory `Queue` batcher.'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# @warlock.js/queue
|
|
@@ -8,7 +8,7 @@ Jobs are stored in Redis (default; not bundled), local SQLite without Redis, or
|
|
|
8
8
|
|
|
9
9
|
## The 80% path
|
|
10
10
|
|
|
11
|
-
1.
|
|
11
|
+
1. Use this index for orientation and choose a task below.
|
|
12
12
|
2. Configure `src/config/queue.ts` and register `queueConnector()`: `configure-queue.md`.
|
|
13
13
|
3. Define and dispatch jobs (attempts, backoff, delay, priority, progress): `define-jobs.md`.
|
|
14
14
|
4. Inspect and recover failures, optionally the bull-board dashboard: `manage-failed-jobs.md`.
|
|
@@ -24,3 +24,14 @@ Jobs are stored in Redis (default; not bundled), local SQLite without Redis, or
|
|
|
24
24
|
- Do not value-import from client code.
|
|
25
25
|
|
|
26
26
|
Use the `local-queues` topic for `driver: "local"` / `"memory"`, Node requirements, leases, crash recovery, and cancellation.
|
|
27
|
+
|
|
28
|
+
## Mental model
|
|
29
|
+
|
|
30
|
+
- **Job definition** — `defineJob({ name, handle })` registers a handler by name and returns a typed job.
|
|
31
|
+
- **Dispatch** — `job.dispatch(payload, options)` stores the job in the configured backend. Any process with the same definition and a worker can run it.
|
|
32
|
+
- **Worker** — one per queue name, started by `queueConnector()` (or `startWorkers()`); routes each job to the handler with its name.
|
|
33
|
+
- **Shutdown** — workers stop taking jobs, active jobs finish (up to `workers.shutdownTimeout`), then connections close.
|
|
34
|
+
|
|
35
|
+
## Not core's `Queue`
|
|
36
|
+
|
|
37
|
+
`@warlock.js/core` exports `Queue` — an in-memory batcher that flushes items by size or interval inside one process. No storage, no retries, lost on exit. Use `@warlock.js/queue` when work must survive a restart or be retried.
|
package/skills/overview/SKILL.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: overview
|
|
3
|
-
description: "@warlock.js/queue overview for orientation and choosing the focused skill for the task."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# `@warlock.js/queue` — overview
|
|
7
|
-
|
|
8
|
-
Durable background jobs. Jobs are stored in **Redis** (default), local SQLite without Redis, or memory for tests, retried on failure, and processed by workers — inside the app process by default.
|
|
9
|
-
|
|
10
|
-
## Mental model
|
|
11
|
-
|
|
12
|
-
- **Job definition** — `defineJob({ name, handle })` registers a handler by name and returns a typed job.
|
|
13
|
-
- **Dispatch** — `job.dispatch(payload, options)` stores the job in the configured backend. Any process with the same definition and a worker can run it.
|
|
14
|
-
- **Worker** — one per queue name, started by `queueConnector()` (or `startWorkers()`); routes each job to the handler with its name.
|
|
15
|
-
- **Shutdown** — workers stop taking jobs, active jobs finish (up to `workers.shutdownTimeout`), then connections close.
|
|
16
|
-
|
|
17
|
-
## Not core's `Queue`
|
|
18
|
-
|
|
19
|
-
`@warlock.js/core` exports `Queue` — an in-memory batcher that flushes items by size or interval inside one process. No storage, no retries, lost on exit. Use `@warlock.js/queue` when work must survive a restart or be retried.
|
|
20
|
-
|
|
21
|
-
## Skills index
|
|
22
|
-
|
|
23
|
-
- `local-queues` — SQLite/memory configuration, leases, crash recovery, cancellation.
|
|
24
|
-
- `configure-queue` — `src/config/queue.ts`, `queueConnector()`, workers on/off, shutdown.
|
|
25
|
-
- `define-jobs` — `defineJob`, `dispatch` options, retries, progress, `find`.
|
|
26
|
-
- `manage-failed-jobs` — `failedJobs`, `retryFailedJob`, the bull-board dashboard.
|
|
27
|
-
- `queue-notifications` — `bullmqQueue()` for notifications `.queue()`.
|