bunqueue 2.1.3 → 2.1.4

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 +40 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -64,7 +64,21 @@ bun add bunqueue
64
64
 
65
65
  > Requires [Bun](https://bun.sh) runtime. Node.js is not supported.
66
66
 
67
- ## Quick Example
67
+ ## Two Modes
68
+
69
+ bunqueue runs in two modes depending on your architecture:
70
+
71
+ | | Embedded | Server (TCP) |
72
+ |---|----------|-------------|
73
+ | **How it works** | Queue runs inside your process | Standalone server, clients connect via TCP |
74
+ | **Setup** | `bun add bunqueue` | `docker run` or `bunqueue start` |
75
+ | **Performance** | 286K ops/sec | 149K ops/sec |
76
+ | **Best for** | Single-process apps, CLIs, serverless | Multiple workers, separate producer/consumer |
77
+ | **Scaling** | Same process only | Multiple clients across machines |
78
+
79
+ ### Embedded Mode
80
+
81
+ Everything runs in your process. No server, no network, no setup.
68
82
 
69
83
  ```typescript
70
84
  import { Queue, Worker } from 'bunqueue/client';
@@ -79,6 +93,31 @@ const worker = new Worker('emails', async (job) => {
79
93
  await queue.add('welcome', { to: 'user@example.com' });
80
94
  ```
81
95
 
96
+ ### Server Mode (TCP)
97
+
98
+ Run bunqueue as a standalone server. Multiple workers and producers connect via TCP.
99
+
100
+ ```bash
101
+ # Start with persistent data
102
+ docker run -d -p 6789:6789 -p 6790:6790 \
103
+ -v bunqueue-data:/app/data \
104
+ ghcr.io/egeominotti/bunqueue:latest
105
+ ```
106
+
107
+ Connect from your app:
108
+
109
+ ```typescript
110
+ import { Queue, Worker } from 'bunqueue/client';
111
+
112
+ const queue = new Queue('tasks', { connection: { host: 'localhost', port: 6789 } });
113
+
114
+ const worker = new Worker('tasks', async (job) => {
115
+ return { done: true };
116
+ }, { connection: { host: 'localhost', port: 6789 } });
117
+
118
+ await queue.add('process', { data: 'hello' });
119
+ ```
120
+
82
121
  ## Performance
83
122
 
84
123
  SQLite handles surprisingly high throughput for single-node deployments:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunqueue",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "High-performance job queue server written in TypeScript. SQLite persistence, cron scheduling, priorities, retries, DLQ, webhooks. Minimal dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",