glide-mq 0.7.0 → 0.8.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/CHANGELOG.md +85 -0
- package/LICENSE +191 -0
- package/README.md +65 -50
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +5 -3
- package/dist/connection.js.map +1 -1
- package/dist/errors.d.ts +3 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -1
- package/dist/errors.js.map +1 -1
- package/dist/flow-producer.d.ts.map +1 -1
- package/dist/flow-producer.js +5 -43
- package/dist/flow-producer.js.map +1 -1
- package/dist/functions/index.d.ts +50 -2
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +522 -82
- package/dist/functions/index.js.map +1 -1
- package/dist/graceful-shutdown.d.ts.map +1 -1
- package/dist/graceful-shutdown.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/job.d.ts +30 -0
- package/dist/job.d.ts.map +1 -1
- package/dist/job.js +94 -9
- package/dist/job.js.map +1 -1
- package/dist/queue-events.d.ts.map +1 -1
- package/dist/queue-events.js +12 -6
- package/dist/queue-events.js.map +1 -1
- package/dist/queue.d.ts +50 -2
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +290 -113
- package/dist/queue.js.map +1 -1
- package/dist/sandbox/index.d.ts +10 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +56 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/pool.d.ts +27 -0
- package/dist/sandbox/pool.d.ts.map +1 -0
- package/dist/sandbox/pool.js +273 -0
- package/dist/sandbox/pool.js.map +1 -0
- package/dist/sandbox/runner.d.ts +6 -0
- package/dist/sandbox/runner.d.ts.map +1 -0
- package/dist/sandbox/runner.js +130 -0
- package/dist/sandbox/runner.js.map +1 -0
- package/dist/sandbox/sandbox-job.d.ts +61 -0
- package/dist/sandbox/sandbox-job.d.ts.map +1 -0
- package/dist/sandbox/sandbox-job.js +137 -0
- package/dist/sandbox/sandbox-job.js.map +1 -0
- package/dist/sandbox/types.d.ts +59 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/types.js +25 -0
- package/dist/sandbox/types.js.map +1 -0
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +35 -6
- package/dist/scheduler.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +9 -3
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +36 -2
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +180 -5
- package/dist/testing.js.map +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +3 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -2
- package/dist/utils.js.map +1 -1
- package/dist/worker.d.ts +14 -2
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +137 -18
- package/dist/worker.js.map +1 -1
- package/package.json +13 -1
- package/.env +0 -1
- package/.jules/bolt.md +0 -3
- package/demo/README.md +0 -169
- package/demo/dashboard-server.ts +0 -474
- package/demo/index.ts +0 -502
- package/demo/package-lock.json +0 -2051
- package/demo/package.json +0 -26
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to glide-mq are documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [0.8.0] - 2026-02-23
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `queue.getJobScheduler(name)` - fetch a single scheduler entry by name. Returns `SchedulerEntry | null` with the schedule configuration (pattern/every), job template, and next run timestamp. Completes the scheduler API alongside `upsertJobScheduler`, `getRepeatableJobs`, and `removeJobScheduler` (#51).
|
|
18
|
+
- `queue.getWorkers()` - list all active workers for the queue. Returns `WorkerInfo[]` with id, addr (hostname), pid, startedAt, age (ms), and activeJobs count. Workers register with TTL-based heartbeat keys that auto-expire on crash (#49).
|
|
19
|
+
- `queue.drain(delayed?)` — remove all waiting jobs from the queue without touching active jobs. Pass `true` to also remove delayed/scheduled jobs. Implemented as a single Valkey Server Function call; emits a `'drained'` event (#41).
|
|
20
|
+
- `TestQueue.drain(delayed?)` — in-memory equivalent; removes waiting (and optionally delayed) jobs from `TestQueue`.
|
|
21
|
+
- `active` event on `Worker` and `TestWorker` — emitted with `(job, jobId)` when a job starts processing (#38).
|
|
22
|
+
- `drained` event on `Worker` and `TestWorker` — emitted when the queue transitions from non-empty to empty. A new `isDrained` flag prevents repeated emissions (#38).
|
|
23
|
+
- `queue.clean(grace, limit, type)` — bulk-remove old `completed` or `failed` jobs by minimum age. Returns an array of removed job IDs. Implemented as a single Valkey Server Function call (#39).
|
|
24
|
+
- `job.discard()` — immediately move an active job to failed state, bypassing retries (#40).
|
|
25
|
+
- `UnrecoverableError` — throw this error class inside a processor to skip all remaining retry attempts and fail the job permanently (#40).
|
|
26
|
+
- `job.changePriority(newPriority)` — re-prioritize a waiting, prioritized, or delayed job after enqueue. Setting priority to `0` moves it back to the normal stream. Throws if the job is active, completed, or failed (#43).
|
|
27
|
+
- `job.changeDelay(newDelay)` — mutate the fire time of a delayed job after enqueue. Setting delay to `0` promotes immediately (to waiting or prioritized depending on priority). Setting delay > 0 on a waiting or prioritized job moves it to the scheduled ZSet. Throws if the job is active, completed, or failed (#45).
|
|
28
|
+
- `job.promote()` — move a delayed job to waiting immediately. Always moves to the waiting stream regardless of priority (unlike `changeDelay(0)` which preserves priority scheduling). Priority metadata is kept in the job hash. Throws if the job is not in the delayed state (#46).
|
|
29
|
+
- `queue.retryJobs(opts?)` — bulk-retry failed jobs in a single Valkey Server Function call. Pass `{ count: N }` to limit the number of jobs retried, or omit to retry all. All retried jobs go to the scheduled ZSet (the promote cycle moves them to the stream). Returns the count of retried jobs (#47).
|
|
30
|
+
|
|
31
|
+
### Performance
|
|
32
|
+
|
|
33
|
+
- Batch `getChildrenValues` for O(1) network trips (#50).
|
|
34
|
+
- Batch scheduler operations into single pipeline RTT.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- `job.retry()` — now removes the job from the failed ZSet before adding to scheduled, and resets `attemptsMade` and `finishedOn`.
|
|
39
|
+
- Sanitize stack traces in sandbox runner (#44).
|
|
40
|
+
- Replace hardcoded sleeps with `waitFor` in flaky CI tests (#48).
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- CI pipeline rewrite from scratch.
|
|
45
|
+
- ESLint + Prettier with TypeScript support.
|
|
46
|
+
- Prettier formatting applied to src/ and tests/.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## [0.7.0]
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
- Sandboxed processor: run worker processor in a child process or worker thread (`sandbox: {}` option). Protects the main process from processor crashes and memory leaks (#36).
|
|
55
|
+
- Sandbox pool stress tests (#37).
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Resolved 4 source bugs and 12 flaky test files (#34).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## [0.6.0]
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- Comprehensive README rewrite: star CTA, install command, expanded feature list, differentiators (#35).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## [0.4.0]
|
|
72
|
+
|
|
73
|
+
Initial public release on npm.
|
|
74
|
+
|
|
75
|
+
- Valkey Server Functions for all queue operations (FUNCTION LOAD + FCALL).
|
|
76
|
+
- Hash-tagged keys for cluster compatibility.
|
|
77
|
+
- XREADGROUP + consumer groups + PEL for at-least-once delivery.
|
|
78
|
+
- `completeAndFetchNext` single-RTT job transition.
|
|
79
|
+
- FlowProducer workflows: `chain`, `group`, `chord`.
|
|
80
|
+
- Schedulers: cron and interval repeating jobs.
|
|
81
|
+
- Rate limiting, deduplication, compression, retries, DLQ.
|
|
82
|
+
- Per-key ordering, global concurrency, job revocation.
|
|
83
|
+
- QueueEvents stream-based lifecycle events.
|
|
84
|
+
- In-memory `TestQueue` and `TestWorker` (no Valkey needed).
|
|
85
|
+
- OpenTelemetry tracing, per-job logs.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2024-2026 Avi Fenesh
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,55 +1,45 @@
|
|
|
1
1
|
# glide-mq
|
|
2
2
|
|
|
3
|
-
High-performance message queue for Node.js — Streams
|
|
3
|
+
**High-performance message queue for Node.js** — powered by Valkey/Redis Streams and a Rust-native NAPI client.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Performance
|
|
8
|
-
|
|
9
|
-
### Processing throughput
|
|
10
|
-
|
|
11
|
-
| Concurrency | Throughput |
|
|
12
|
-
|-------------|-----------|
|
|
13
|
-
| c=1 | 4,376 jobs/s |
|
|
14
|
-
| c=5 | 14,925 jobs/s |
|
|
15
|
-
| c=10 | 15,504 jobs/s |
|
|
16
|
-
| c=50 | 48,077 jobs/s |
|
|
17
|
-
|
|
18
|
-
### Bulk add (`addBulk` via Batch API)
|
|
19
|
-
|
|
20
|
-
| Jobs | Serial | Batch | Speedup |
|
|
21
|
-
|------|--------|-------|---------|
|
|
22
|
-
| 200 | 76ms | 14ms | 5.4x |
|
|
23
|
-
| 1,000 | 228ms | 18ms | 12.7x |
|
|
24
|
-
|
|
25
|
-
### Payload compression
|
|
26
|
-
|
|
27
|
-
| Mode | Stored size (15KB payload) | Savings |
|
|
28
|
-
|------|--------------------------|---------|
|
|
29
|
-
| Plain | 15,327 bytes | — |
|
|
30
|
-
| Gzip | 331 bytes | 98% |
|
|
31
|
-
|
|
32
|
-
*No-op processor, Valkey 8.0, single node.*
|
|
33
|
-
|
|
34
|
-
## Why glide-mq
|
|
35
|
-
|
|
36
|
-
| Feature | glide-mq | Traditional queue |
|
|
37
|
-
|---------|----------|-------------------|
|
|
38
|
-
| Queue backend | Streams + PEL | Lists + BRPOPLPUSH |
|
|
39
|
-
| Server scripts | 1 function library | 53 EVAL scripts |
|
|
40
|
-
| RTT per job | 1 (`completeAndFetchNext`) | 2+ |
|
|
41
|
-
| Cluster support | Built-in hash tags | Afterthought `{braces}` |
|
|
42
|
-
| Client | NAPI Rust core | ioredis |
|
|
43
|
-
| AZ-Affinity | ✓ | ✗ |
|
|
44
|
-
| IAM auth | ✓ | ✗ |
|
|
45
|
-
|
|
46
|
-
## Install
|
|
5
|
+
If you find this useful, [give it a ⭐ on GitHub](https://github.com/avifenesh/glide-mq) — it helps the project reach more developers.
|
|
47
6
|
|
|
48
7
|
```bash
|
|
49
8
|
npm install glide-mq
|
|
50
9
|
```
|
|
51
10
|
|
|
52
|
-
|
|
11
|
+
## Why glide-mq
|
|
12
|
+
|
|
13
|
+
- **1 RTT per job** — `completeAndFetchNext` finishes the current job and fetches the next one in a single round-trip
|
|
14
|
+
- **Rust core, not ioredis** — built on [Valkey GLIDE](https://github.com/valkey-io/valkey-glide)'s native NAPI bindings for lower latency and less GC pressure
|
|
15
|
+
- **1 function library, not 53 scripts** — all queue logic runs as a single Valkey Server Function (no EVAL overhead)
|
|
16
|
+
- **Cluster-native** — hash-tagged keys work out of the box; no manual `{braces}` needed
|
|
17
|
+
- **Cloud-ready** — AZ-affinity routing and IAM auth built in
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Queues & Workers** — producer/consumer with configurable concurrency
|
|
22
|
+
- **Delayed & priority jobs** — schedule jobs for later or run high-priority work first
|
|
23
|
+
- **Workflows** — `FlowProducer` parent-child trees, `chain`, `group`, `chord` pipelines with result aggregation
|
|
24
|
+
- **Schedulers** — cron and interval repeatable jobs, persisted across restarts
|
|
25
|
+
- **Per-key ordering** — sequential processing per key while staying parallel across keys
|
|
26
|
+
- **Rate limiting** — token-bucket (cost-based), per-group, and global rate limiting
|
|
27
|
+
- **Retries & DLQ** — exponential/fixed/custom backoff with dead-letter queues
|
|
28
|
+
- **Deduplication** — simple, throttle, and debounce modes with configurable TTL
|
|
29
|
+
- **Job revocation** — cooperative cancellation via AbortSignal for active jobs
|
|
30
|
+
- **Stalled job recovery** — auto-reclaim jobs from crashed workers via XAUTOCLAIM
|
|
31
|
+
- **Global concurrency** — cross-worker active job cap for the entire queue
|
|
32
|
+
- **Pause & resume** — pause/resume at queue level or per-worker, with force option
|
|
33
|
+
- **Drain** — `queue.drain(delayed?)` removes all waiting (and optionally delayed) jobs in a single server-side call
|
|
34
|
+
- **Real-time events** — `QueueEvents` stream for added, completed, failed, stalled, revoked, and more
|
|
35
|
+
- **Job search** — query by state, name, and data filters
|
|
36
|
+
- **Progress tracking** — real-time numeric or object progress updates
|
|
37
|
+
- **Batch API** — `addBulk` for high-throughput ingestion (12.7× faster than serial)
|
|
38
|
+
- **Compression** — transparent gzip (up to 98% size reduction)
|
|
39
|
+
- **Graceful shutdown** — one-liner `gracefulShutdown()` for SIGTERM/SIGINT handling
|
|
40
|
+
- **Connection sharing** — reuse a single client across components to reduce TCP connections
|
|
41
|
+
- **Observability** — OpenTelemetry tracing, per-job logs, [`@glidemq/dashboard`](https://github.com/avifenesh/glidemq-dashboard) web UI
|
|
42
|
+
- **In-memory testing** — `TestQueue` & `TestWorker` with zero dependencies via `glide-mq/testing`
|
|
53
43
|
|
|
54
44
|
## Quick Start
|
|
55
45
|
|
|
@@ -72,14 +62,39 @@ worker.on('completed', (job) => console.log(`Job ${job.id} done`));
|
|
|
72
62
|
worker.on('failed', (job, err) => console.error(`Job ${job.id} failed:`, err.message));
|
|
73
63
|
```
|
|
74
64
|
|
|
65
|
+
Requires Node.js 20+ and a running [Valkey](https://valkey.io) (7.0+) or Redis 7.0+ instance.
|
|
66
|
+
|
|
67
|
+
## Benchmarks
|
|
68
|
+
|
|
69
|
+
| Concurrency | Throughput |
|
|
70
|
+
|-------------|-----------|
|
|
71
|
+
| c=1 | 4,376 jobs/s |
|
|
72
|
+
| c=5 | 14,925 jobs/s |
|
|
73
|
+
| c=10 | 15,504 jobs/s |
|
|
74
|
+
| c=50 | 48,077 jobs/s |
|
|
75
|
+
|
|
76
|
+
`addBulk` batch API: **1,000 jobs in 18 ms** (12.7× faster than serial).
|
|
77
|
+
Gzip compression: **98% payload reduction** on 15 KB payloads.
|
|
78
|
+
|
|
79
|
+
*Valkey 8.0, single node, no-op processor. Run `npm run bench` to reproduce.*
|
|
80
|
+
|
|
75
81
|
## Documentation
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
| Guide | What you'll learn |
|
|
84
|
+
|-------|-------------------|
|
|
85
|
+
| [Usage](docs/USAGE.md) | Queue & Worker basics, graceful shutdown, cluster mode |
|
|
86
|
+
| [Advanced](docs/ADVANCED.md) | Schedulers, rate limiting, dedup, compression, retries & DLQ |
|
|
87
|
+
| [Workflows](docs/WORKFLOWS.md) | FlowProducer, `chain`, `group`, `chord` pipelines |
|
|
88
|
+
| [Observability](docs/OBSERVABILITY.md) | OpenTelemetry, job logs, `@glidemq/dashboard` |
|
|
89
|
+
| [Testing](docs/TESTING.md) | In-memory `TestQueue` & `TestWorker` — no Valkey needed |
|
|
90
|
+
| [Architecture](docs/ARCHITECTURE.md) | Key design, Valkey functions, data layout |
|
|
91
|
+
| [Migration](docs/MIGRATION.md) | Coming from BullMQ? API mapping & workarounds |
|
|
92
|
+
|
|
93
|
+
## Get Involved
|
|
94
|
+
|
|
95
|
+
- ⭐ [Star on GitHub](https://github.com/avifenesh/glide-mq) — helps others find the project
|
|
96
|
+
- 🐛 [Open an issue](https://github.com/avifenesh/glide-mq/issues) — bug reports & feature requests welcome
|
|
97
|
+
- 💬 [Discussions](https://github.com/avifenesh/glide-mq/discussions) — questions, ideas, show & tell
|
|
83
98
|
|
|
84
99
|
## License
|
|
85
100
|
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAkB,MAAM,SAAS,CAAC;AA4BzE;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB3E;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAkB,MAAM,SAAS,CAAC;AA4BzE;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB3E;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKvD;AAID;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,MAAuB,EACtC,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,MAAuB,EACtC,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC,IAAI,CAAC,CA+Bf;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,MAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
package/dist/connection.js
CHANGED
|
@@ -70,8 +70,7 @@ function isClusterClient(client) {
|
|
|
70
70
|
return true;
|
|
71
71
|
// Duck-type fallback: GlideClusterClient has scan(ClusterScanCursor, ...) signature
|
|
72
72
|
// while GlideClient has scan(cursor: string, ...) - check for cluster-specific method
|
|
73
|
-
return typeof client.clusterScan === 'function'
|
|
74
|
-
|| client.constructor?.name === 'GlideClusterClient';
|
|
73
|
+
return typeof client.clusterScan === 'function' || client.constructor?.name === 'GlideClusterClient';
|
|
75
74
|
}
|
|
76
75
|
const _libraryLoadPromises = new WeakMap();
|
|
77
76
|
/**
|
|
@@ -123,7 +122,10 @@ async function ensureFunctionLibrary(client, librarySource = index_1.LIBRARY_SOU
|
|
|
123
122
|
}
|
|
124
123
|
catch (err) {
|
|
125
124
|
const msg = err instanceof Error ? err.message : String(err);
|
|
126
|
-
if (!msg.includes('Function not loaded') &&
|
|
125
|
+
if (!msg.includes('Function not loaded') &&
|
|
126
|
+
!msg.includes('Function not found') &&
|
|
127
|
+
!msg.includes('No matching script') &&
|
|
128
|
+
!msg.includes('NOSCRIPT')) {
|
|
127
129
|
throw err;
|
|
128
130
|
}
|
|
129
131
|
}
|
package/dist/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;AAiCA,oCAoBC;AAMD,oDAEC;AAOD,
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;AAiCA,oCAoBC;A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;;;;GASG;AACI,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,SAAiB,EACjB,SAAiB,EACjB,UAAkB,GAAG;IAErB,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;YACvD,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yDAAyD;QACzD,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9D,OAAO;QACT,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -7,4 +7,7 @@ export declare class ConnectionError extends GlideMQError {
|
|
|
7
7
|
export declare class ScriptError extends GlideMQError {
|
|
8
8
|
constructor(message: string);
|
|
9
9
|
}
|
|
10
|
+
export declare class UnrecoverableError extends GlideMQError {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
10
13
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,OAAO,EAAE,MAAM;CAI5B"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ScriptError = exports.ConnectionError = exports.GlideMQError = void 0;
|
|
3
|
+
exports.UnrecoverableError = exports.ScriptError = exports.ConnectionError = exports.GlideMQError = void 0;
|
|
4
4
|
class GlideMQError extends Error {
|
|
5
5
|
constructor(message) {
|
|
6
6
|
super(message);
|
|
@@ -22,4 +22,11 @@ class ScriptError extends GlideMQError {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.ScriptError = ScriptError;
|
|
25
|
+
class UnrecoverableError extends GlideMQError {
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = 'UnrecoverableError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.UnrecoverableError = UnrecoverableError;
|
|
25
32
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AALD,oCAKC;AAED,MAAa,eAAgB,SAAQ,YAAY;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,WAAY,SAAQ,YAAY;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AALD,kCAKC"}
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AALD,oCAKC;AAED,MAAa,eAAgB,SAAQ,YAAY;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,WAAY,SAAQ,YAAY;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AALD,kCAKC;AAED,MAAa,kBAAmB,SAAQ,YAAY;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AALD,gDAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-producer.d.ts","sourceRoot":"","sources":["../src/flow-producer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAU,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAO5B,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,EAAE,mBAAmB;IAOrC,gBAAgB;YACF,SAAS;
|
|
1
|
+
{"version":3,"file":"flow-producer.d.ts","sourceRoot":"","sources":["../src/flow-producer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAU,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAO5B,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,EAAE,mBAAmB;IAOrC,gBAAgB;YACF,SAAS;IAoBvB;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IASnD;;;;OAIG;YACW,gBAAgB;IA8I9B;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAU7B"}
|
package/dist/flow-producer.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.FlowProducer = void 0;
|
|
37
4
|
const job_1 = require("./job");
|
|
@@ -59,8 +26,7 @@ class FlowProducer {
|
|
|
59
26
|
if (!this.client) {
|
|
60
27
|
if (this.opts.client) {
|
|
61
28
|
const injected = this.opts.client;
|
|
62
|
-
const clusterMode = this.opts.connection?.clusterMode
|
|
63
|
-
?? (0, connection_1.isClusterClient)(injected);
|
|
29
|
+
const clusterMode = this.opts.connection?.clusterMode ?? (0, connection_1.isClusterClient)(injected);
|
|
64
30
|
await (0, connection_1.ensureFunctionLibraryOnce)(injected, index_1.LIBRARY_SOURCE, clusterMode);
|
|
65
31
|
this.client = injected;
|
|
66
32
|
this.clientOwned = false;
|
|
@@ -110,23 +76,19 @@ class FlowProducer {
|
|
|
110
76
|
const parentKeys = (0, utils_1.buildKeys)(parentQueueName, prefix);
|
|
111
77
|
// If no children, this is a leaf - add as a regular job (not a flow)
|
|
112
78
|
if (!flow.children || flow.children.length === 0) {
|
|
113
|
-
const { addJob } = await Promise.resolve().then(() => __importStar(require('./functions/index')));
|
|
114
79
|
const timestamp = Date.now();
|
|
115
80
|
const opts = flow.opts ?? {};
|
|
116
81
|
const groupRateMax = opts.ordering?.rateLimit?.max ?? 0;
|
|
117
82
|
const groupRateDuration = opts.ordering?.rateLimit?.duration ?? 0;
|
|
118
|
-
const tbCapacity = opts.ordering?.tokenBucket
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
? Math.round(opts.ordering.tokenBucket.refillRate * 1000) : 0;
|
|
122
|
-
const jobCost = opts.cost != null
|
|
123
|
-
? Math.round(opts.cost * 1000) : 0;
|
|
83
|
+
const tbCapacity = opts.ordering?.tokenBucket ? Math.round(opts.ordering.tokenBucket.capacity * 1000) : 0;
|
|
84
|
+
const tbRefillRate = opts.ordering?.tokenBucket ? Math.round(opts.ordering.tokenBucket.refillRate * 1000) : 0;
|
|
85
|
+
const jobCost = opts.cost != null ? Math.round(opts.cost * 1000) : 0;
|
|
124
86
|
let groupConcurrency = opts.ordering?.concurrency ?? 0;
|
|
125
87
|
// Force group path when rate limit or token bucket is set
|
|
126
88
|
if ((groupRateMax > 0 || tbCapacity > 0) && groupConcurrency < 1) {
|
|
127
89
|
groupConcurrency = 1;
|
|
128
90
|
}
|
|
129
|
-
const jobId = await addJob(client, parentKeys, flow.name, JSON.stringify(flow.data), JSON.stringify(opts), timestamp, opts.delay ?? 0, opts.priority ?? 0, '', opts.attempts ?? 0, opts.ordering?.key ?? '', groupConcurrency, groupRateMax, groupRateDuration, tbCapacity, tbRefillRate, jobCost);
|
|
91
|
+
const jobId = await (0, index_1.addJob)(client, parentKeys, flow.name, JSON.stringify(flow.data), JSON.stringify(opts), timestamp, opts.delay ?? 0, opts.priority ?? 0, '', opts.attempts ?? 0, opts.ordering?.key ?? '', groupConcurrency, groupRateMax, groupRateDuration, tbCapacity, tbRefillRate, jobCost);
|
|
130
92
|
if (String(jobId) === 'ERR:COST_EXCEEDS_CAPACITY') {
|
|
131
93
|
throw new Error('Job cost exceeds token bucket capacity');
|
|
132
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-producer.js","sourceRoot":"","sources":["../src/flow-producer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-producer.js","sourceRoot":"","sources":["../src/flow-producer.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAC5B,mCAA+C;AAC/C,6CAA+G;AAC/G,qCAAwC;AACxC,6CAAoE;AACpE,2CAAuC;AAOvC,MAAa,YAAY;IACf,IAAI,CAAsB;IAC1B,MAAM,GAAkB,IAAI,CAAC;IAC7B,WAAW,GAAG,IAAI,CAAC;IACnB,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,IAAyB;QACnC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,qBAAY,CAAC,mDAAmD,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,gBAAgB;IACR,KAAK,CAAC,SAAS;QACrB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,qBAAY,CAAC,yBAAyB,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;gBAClC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,IAAI,IAAA,4BA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