light-async-queue 1.0.0 β 1.0.1
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 +18 -35
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/gaikwadakshay79/light-async-queue/actions/workflows/ci.yml)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://nodejs.org)
|
|
8
|
-
[](https://www.typescriptlang.org/)
|
|
9
9
|
|
|
10
10
|
A production-ready, Redis-free async job queue for Node.js with TypeScript. Designed for single-node reliability with file-based persistence, worker process isolation, and crash recovery.
|
|
11
11
|
|
|
@@ -29,39 +29,22 @@ npm install light-async-queue
|
|
|
29
29
|
|
|
30
30
|
## ποΈ Architecture
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
βββββββΌβββββββββββββββββββββββΌβββββββ
|
|
49
|
-
β Worker Pool β
|
|
50
|
-
β ββββββββ ββββββββ ββββββββ β
|
|
51
|
-
β βWorkerβ βWorkerβ βWorkerβ β
|
|
52
|
-
β β (CP) β β (CP) β β (CP) β β
|
|
53
|
-
β ββββββββ ββββββββ ββββββββ β
|
|
54
|
-
ββββββββββββββββββ¬ββββββββββββββββββββ
|
|
55
|
-
β
|
|
56
|
-
β on failure
|
|
57
|
-
β
|
|
58
|
-
βββββββββΌβββββββββ
|
|
59
|
-
β Dead Letter β
|
|
60
|
-
β Queue (DLQ) β
|
|
61
|
-
ββββββββββββββββββ
|
|
62
|
-
|
|
63
|
-
CP = Child Process (isolated execution)
|
|
64
|
-
```
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
The queue follows a producer-consumer pattern with the following components:
|
|
35
|
+
|
|
36
|
+
- **Queue API**: Main interface for adding jobs and managing the queue
|
|
37
|
+
- **Scheduler**: Polls for ready jobs every 200ms and dispatches to workers
|
|
38
|
+
- **Storage Layer**: Pluggable storage (Memory or File-based) for job persistence
|
|
39
|
+
- **Worker Pool**: Manages concurrent job execution in isolated child processes
|
|
40
|
+
- **Dead Letter Queue (DLQ)**: Stores jobs that exceeded max retry attempts
|
|
41
|
+
|
|
42
|
+
**Key Features:**
|
|
43
|
+
|
|
44
|
+
- Jobs execute in isolated child processes for crash resilience
|
|
45
|
+
- File-based storage provides automatic crash recovery
|
|
46
|
+
- Exponential backoff retry strategy prevents overwhelming failing services
|
|
47
|
+
- Graceful shutdown ensures no job loss during deployment
|
|
65
48
|
|
|
66
49
|
## π Quick Start
|
|
67
50
|
|
|
@@ -368,7 +351,7 @@ npm run build
|
|
|
368
351
|
npm run example
|
|
369
352
|
```
|
|
370
353
|
|
|
371
|
-
**Test Results:** β
|
|
354
|
+
**Test Results:** β
42 tests passing across 4 test suites (powered by Vitest)
|
|
372
355
|
|
|
373
356
|
See [TEST_SUITE.md](./TEST_SUITE.md) for detailed test documentation.
|
|
374
357
|
|