@bymax-one/nest-queue 1.2.7 → 1.2.8

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 (3) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +35 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,25 @@ versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
12
  ---
13
13
 
14
+ ## [1.2.8] — 2026-11-01
15
+
16
+ No action required: behaviour, the public API, the types and the peer ranges are unchanged.
17
+ Measured with `diff -r` of a fresh build against the unpacked 1.2.7 tarball, `dist/` is identical;
18
+ the package otherwise changes in `README.md`, this file and the version in `package.json`.
19
+
20
+ ### Documentation
21
+
22
+ - **The README now states how many Redis connections the library holds.** A new "Redis connections"
23
+ section gives the budget measured against Redis 8: 1 for the module in Mode B and none of its own
24
+ in Mode A, 2 per worker, 2 per queue observed with `@OnQueueEvent`, and none for producers and
25
+ flows, all released on close. It carries a worked example (20 workers and 5 observed queues hold
26
+ 51 connections in Mode B) and a note on connection quotas of managed Redis plans.
27
+ - **The Mode B description of the connections was wrong.** It said the library opens one connection
28
+ per worker and per observed queue; each of those holds two, a blocking connection and a command
29
+ connection.
30
+
31
+ ---
32
+
14
33
  ## [1.2.7] — 2026-10-31
15
34
 
16
35
  Action required if your `connection.url` can be empty or malformed: an invalid or empty
@@ -728,7 +747,8 @@ v6 peer range.
728
747
 
729
748
  ---
730
749
 
731
- [Unreleased]: https://github.com/bymaxone/nest-queue/compare/v1.2.7...HEAD
750
+ [Unreleased]: https://github.com/bymaxone/nest-queue/compare/v1.2.8...HEAD
751
+ [1.2.8]: https://github.com/bymaxone/nest-queue/compare/v1.2.7...v1.2.8
732
752
  [1.2.7]: https://github.com/bymaxone/nest-queue/compare/v1.2.6...v1.2.7
733
753
  [1.2.6]: https://github.com/bymaxone/nest-queue/compare/v1.2.5...v1.2.6
734
754
  [1.2.5]: https://github.com/bymaxone/nest-queue/compare/v1.2.4...v1.2.5
package/README.md CHANGED
@@ -313,8 +313,41 @@ BymaxQueueModule.forRoot({
313
313
  })
314
314
  ```
315
315
 
316
- The library opens one connection for queues, one per worker and one per queue that has an
317
- `@OnQueueEvent` listener. The worker and `QueueEvents` connections carry `maxRetriesPerRequest: null`.
316
+ The library opens one connection for all queues and flows, and two for each worker and for each
317
+ queue that has an `@OnQueueEvent` listener ([the budget is below](#-redis-connections)). The worker
318
+ and `QueueEvents` connections carry `maxRetriesPerRequest: null`.
319
+
320
+ ---
321
+
322
+ ## 🔌 Redis connections
323
+
324
+ How many connections the library holds is linear in what you register, so you can budget it before
325
+ you deploy. Counts were read from `INFO clients` against Redis 8 with BullMQ 6 and `ioredis` 6, and
326
+ every connection is released when the application context closes.
327
+
328
+ | What you register | Connections held |
329
+ | ---------------------------------------------- | ------------------------------------------------------------------------------ |
330
+ | The module (Mode B, library-owned connection) | 1, shared by every producer and every flow |
331
+ | The module (Mode A, your client) | 0 of its own; your client is yours and is never counted |
332
+ | A queue you enqueue to, with `QueueService` | 0 more: queues share the module's connection |
333
+ | `FlowService` (flows enabled) | 0 more |
334
+ | Each worker (`@Processor` or `WorkerRegistry`) | 2: a blocking connection that waits for jobs, and a command connection |
335
+ | Each queue observed with `@OnQueueEvent` | 2: a blocking connection that reads the event stream, and a command connection |
336
+
337
+ Producers and flows add nothing, so the cost comes from consumers. The blocking connection of a
338
+ worker cannot be shared: it is parked inside a blocking command until a job arrives.
339
+
340
+ **Worked example.** One application instance in Mode B with 20 workers and 5 queues observed with
341
+ `@OnQueueEvent` holds 1 + (2 × 20) + (2 × 5) = **51** connections; in Mode A the same instance holds
342
+ 50, plus whatever your own client uses. Each instance of the application opens its own set, so three
343
+ instances hold 153.
344
+
345
+ **Managed Redis.** Hosted Redis plans cap the number of concurrent connections, and a plan sized for
346
+ a handful of clients is exhausted by one instance with a few dozen workers. Multiply the table by
347
+ the number of instances you run (include rolling deploys, where old and new instances overlap) and
348
+ compare it with the limit of your plan; self-managed Redis allows 10 000 by default (`maxclients`).
349
+ In `CLIENT LIST`, the blocking connection of a worker has a name that starts with
350
+ `<prefix>:<base64 of the queue name>`, which identifies it; the command connection is unnamed.
318
351
 
319
352
  ---
320
353
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bymax-one/nest-queue",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "NestJS dynamic module wrapping BullMQ — typed jobs, flows, job schedulers, deduplication, OpenTelemetry, graceful shutdown",
5
5
  "author": "Bymax One <support@bymax.one>",
6
6
  "license": "MIT",