power-queues 2.0.17 → 2.0.18
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/README.md +77 -75
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,62 @@ Full documentation is available here:
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
# 📦 Installation
|
|
33
|
+
|
|
34
|
+
``` bash
|
|
35
|
+
npm install power-queues
|
|
36
|
+
```
|
|
37
|
+
OR
|
|
38
|
+
```bash
|
|
39
|
+
yarn add power-queues
|
|
40
|
+
```
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
# 🧪 Quick Start
|
|
44
|
+
|
|
45
|
+
``` ts
|
|
46
|
+
const queue = new PowerQueues({
|
|
47
|
+
stream: "email",
|
|
48
|
+
group: "workers",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
await queue.loadScripts(true);
|
|
52
|
+
|
|
53
|
+
await queue.addTasks("email", [
|
|
54
|
+
{ payload: { type: "welcome", userId: 42 } },
|
|
55
|
+
]);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Worker:
|
|
59
|
+
|
|
60
|
+
``` ts
|
|
61
|
+
class EmailWorker extends PowerQueues {
|
|
62
|
+
async onExecute(id, payload) {
|
|
63
|
+
await sendEmail(payload);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
# ⚙ power-queues vs Existing Solutions
|
|
71
|
+
|
|
72
|
+
|Feature |power-queues |BullMQ |Bee-Queue |Custom Streams|
|
|
73
|
+
|----------------------|----------------|----------- |------------|--------------|
|
|
74
|
+
|Bulk XADD (Lua) |✅ Yes |❌ No |❌ No |Rare |
|
|
75
|
+
|Idempotent workers |✅ Built-in |Partial |❌ No |❌ No |
|
|
76
|
+
|Stuck-task recovery |✅ Advanced |Basic |❌ No |Manual |
|
|
77
|
+
|Heartbeats |✅ Yes |Limited |❌ No |Manual |
|
|
78
|
+
|Retry logic |✅ Flexible |Good |Basic |Manual |
|
|
79
|
+
|DLQ |✅ Native |Basic |❌ No |Manual |
|
|
80
|
+
|Pure Streams |✅ Yes |Partial |❌ No |Yes |
|
|
81
|
+
|Lua optimization |✅ Strong |Minimal |❌ No |Manual |
|
|
82
|
+
|Throughput |🔥 Very high |High |Medium |Depends |
|
|
83
|
+
|Overhead |Low |Medium |Low |Very high |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
# 🚀 Key Features
|
|
33
88
|
|
|
34
89
|
### **1. Ultra‑Fast Bulk XADD (Lua‑Powered)**
|
|
35
90
|
|
|
@@ -146,60 +201,7 @@ Useful for UI dashboards and real‑time job progress visualization.
|
|
|
146
201
|
|
|
147
202
|
---
|
|
148
203
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
``` bash
|
|
152
|
-
npm install power-queues
|
|
153
|
-
```
|
|
154
|
-
OR
|
|
155
|
-
```bash
|
|
156
|
-
yarn add power-queues
|
|
157
|
-
```
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## 🧪 Quick Start
|
|
161
|
-
|
|
162
|
-
``` ts
|
|
163
|
-
const queue = new PowerQueues({
|
|
164
|
-
stream: "email",
|
|
165
|
-
group: "workers",
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
await queue.loadScripts(true);
|
|
169
|
-
|
|
170
|
-
await queue.addTasks("email", [
|
|
171
|
-
{ payload: { type: "welcome", userId: 42 } },
|
|
172
|
-
]);
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Worker:
|
|
176
|
-
|
|
177
|
-
``` ts
|
|
178
|
-
class EmailWorker extends PowerQueues {
|
|
179
|
-
async onExecute(id, payload) {
|
|
180
|
-
await sendEmail(payload);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## ⚙ power-queues vs Existing Solutions
|
|
188
|
-
|
|
189
|
-
|Feature |power-queues |BullMQ |Bee-Queue |Custom Streams|
|
|
190
|
-
|----------------------|----------------|----------- |------------|--------------|
|
|
191
|
-
|Bulk XADD (Lua) |✅ Yes |❌ No |❌ No |Rare |
|
|
192
|
-
|Idempotent workers |✅ Built-in |Partial |❌ No |❌ No |
|
|
193
|
-
|Stuck-task recovery |✅ Advanced |Basic |❌ No |Manual |
|
|
194
|
-
|Heartbeats |✅ Yes |Limited |❌ No |Manual |
|
|
195
|
-
|Retry logic |✅ Flexible |Good |Basic |Manual |
|
|
196
|
-
|DLQ |✅ Native |Basic |❌ No |Manual |
|
|
197
|
-
|Pure Streams |✅ Yes |Partial |❌ No |Yes |
|
|
198
|
-
|Lua optimization |✅ Strong |Minimal |❌ No |Manual |
|
|
199
|
-
|Throughput |🔥 Very high |High |Medium |Depends |
|
|
200
|
-
|Overhead |Low |Medium |Low |Very high |
|
|
201
|
-
|
|
202
|
-
## 🛠 When to Choose power-queues
|
|
204
|
+
# 🛠 When to Choose power-queues
|
|
203
205
|
|
|
204
206
|
Use this engine if you need:
|
|
205
207
|
|
|
@@ -225,7 +227,7 @@ Backpressure, recovery, retries, dead-lettering - all included.
|
|
|
225
227
|
|
|
226
228
|
---
|
|
227
229
|
|
|
228
|
-
|
|
230
|
+
# 🏗️ Project Structure & Architecture
|
|
229
231
|
|
|
230
232
|
- Redis Streams for messaging
|
|
231
233
|
- Lua scripts for atomic operations
|
|
@@ -236,7 +238,7 @@ Backpressure, recovery, retries, dead-lettering - all included.
|
|
|
236
238
|
|
|
237
239
|
---
|
|
238
240
|
|
|
239
|
-
|
|
241
|
+
# 🧩 Extensibility
|
|
240
242
|
|
|
241
243
|
power-queues is ideal for building:
|
|
242
244
|
|
|
@@ -251,7 +253,7 @@ power-queues is ideal for building:
|
|
|
251
253
|
|
|
252
254
|
---
|
|
253
255
|
|
|
254
|
-
|
|
256
|
+
# 🧱 Reliability First
|
|
255
257
|
|
|
256
258
|
Every part of the engine is designed to prevent:
|
|
257
259
|
|
|
@@ -267,6 +269,23 @@ chaotic cluster environments.
|
|
|
267
269
|
|
|
268
270
|
---
|
|
269
271
|
|
|
272
|
+
## ⭐ Why This Project Exists
|
|
273
|
+
|
|
274
|
+
Most Node.js queue libraries are: - too slow
|
|
275
|
+
- too abstract
|
|
276
|
+
- not idempotent
|
|
277
|
+
- not safe for financial or mission‑critical workloads
|
|
278
|
+
|
|
279
|
+
power-queues was built to solve real production problems where: -
|
|
280
|
+
*duplicate tasks cost money*,
|
|
281
|
+
- *workers are unstable*,
|
|
282
|
+
- *tasks must survive restarts*,
|
|
283
|
+
- *performance matters at scale*.
|
|
284
|
+
|
|
285
|
+
If these things matter to you - this engine will feel like home.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
270
289
|
## 🏷️ SEO‑Optimized Keywords (Non‑Spam)
|
|
271
290
|
|
|
272
291
|
power-queues is relevant for:
|
|
@@ -287,20 +306,3 @@ power-queues is relevant for:
|
|
|
287
306
|
## 📝 License
|
|
288
307
|
|
|
289
308
|
MIT - free for commercial and private use.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
## ⭐ Why This Project Exists
|
|
294
|
-
|
|
295
|
-
Most Node.js queue libraries are: - too slow
|
|
296
|
-
- too abstract
|
|
297
|
-
- not idempotent
|
|
298
|
-
- not safe for financial or mission‑critical workloads
|
|
299
|
-
|
|
300
|
-
power-queues was built to solve real production problems where: -
|
|
301
|
-
*duplicate tasks cost money*,
|
|
302
|
-
- *workers are unstable*,
|
|
303
|
-
- *tasks must survive restarts*,
|
|
304
|
-
- *performance matters at scale*.
|
|
305
|
-
|
|
306
|
-
If these things matter to you - this engine will feel like home.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "power-queues",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"description": "High-performance Redis Streams queue for Node.js with Lua-powered bulk XADD, idempotent workers, heartbeat locks, stuck-task recovery, retries, DLQ, and distributed processing.",
|
|
5
5
|
"author": "ihor-bielchenko",
|
|
6
6
|
"license": "MIT",
|