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.
Files changed (2) hide show
  1. package/README.md +18 -35
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![CI](https://github.com/gaikwadakshay79/light-async-queue/actions/workflows/ci.yml/badge.svg)](https://github.com/gaikwadakshay79/light-async-queue/actions/workflows/ci.yml)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node.js Version](https://img.shields.io/node/v/light-async-queue.svg)](https://nodejs.org)
8
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://www.typescriptlang.org/)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](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
- β”‚ Queue API β”‚
35
- β”‚ (add jobs, process, getStats, shutdown) β”‚
36
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
37
- β”‚
38
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
39
- β”‚ β”‚
40
- β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
41
- β”‚ Scheduler β”‚ β”‚ Storage β”‚
42
- β”‚ (200ms) │◄──────── (Memory/ β”‚
43
- β”‚ β”‚ β”‚ File) β”‚
44
- β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
45
- β”‚ β”‚
46
- β”‚ job-ready β”‚ persist
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
+ ![Architecture Diagram](./architecture.png)
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:** βœ… 25 tests passing across 4 test suites (powered by Vitest)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "light-async-queue",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Production-ready Redis-free async job queue for single-node reliability",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",