Skip to content

Commit d65da0c

Browse files
Version Packages
1 parent f848df9 commit d65da0c

File tree

13 files changed

+97
-64
lines changed

13 files changed

+97
-64
lines changed

.changeset/fine-taxes-drive.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/sweet-oranges-cut.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

.changeset/wet-sites-juggle.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/adapter-drizzle/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @vorsteh-queue/adapter-drizzle
22

3+
## 0.4.0
4+
5+
### Minor Changes
6+
7+
- b18ec50: Added support for batch processing
8+
9+
### Patch Changes
10+
11+
- 35f7171: update dependencies
12+
- Updated dependencies [66c4848]
13+
- Updated dependencies [35f7171]
14+
- @vorsteh-queue/core@0.4.0
15+
316
## 0.3.3
417

518
### Patch Changes

packages/adapter-drizzle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vorsteh-queue/adapter-drizzle",
3-
"version": "0.3.3",
3+
"version": "0.4.0",
44
"description": "Drizzle ORM adapter for Vorsteh Queue with PostgreSQL support",
55
"keywords": [
66
"queue",

packages/adapter-kysely/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @vorsteh-queue/adapter-kysely
22

3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- b18ec50: Added support for batch processing
8+
9+
### Patch Changes
10+
11+
- 35f7171: update dependencies
12+
- Updated dependencies [66c4848]
13+
- Updated dependencies [35f7171]
14+
- @vorsteh-queue/core@0.4.0
15+
316
## 0.1.1
417

518
### Patch Changes

packages/adapter-kysely/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vorsteh-queue/adapter-kysely",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Kysely adapter for Vorsteh Queue with PostgreSQL support",
55
"keywords": [
66
"queue",

packages/adapter-prisma/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# @vorsteh-queue/adapter-prisma
22

3+
## 0.3.0
4+
5+
### Minor Changes
6+
7+
- b18ec50: Added support for batch processing
8+
9+
### Patch Changes
10+
11+
- 35f7171: update dependencies
12+
- Updated dependencies [66c4848]
13+
- Updated dependencies [35f7171]
14+
- @vorsteh-queue/core@0.4.0
15+
316
## 0.2.3
417

518
### Patch Changes

packages/adapter-prisma/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vorsteh-queue/adapter-prisma",
3-
"version": "0.2.3",
3+
"version": "0.3.0",
44
"description": "Prisma ORM adapter for Vorsteh Queue with PostgreSQL support",
55
"keywords": [
66
"queue",

packages/core/CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# @vorsteh-queue/core
22

3+
## 0.4.0
4+
5+
### Minor Changes
6+
7+
- 66c4848: ### Added
8+
- Batch processing support: You can now register batch handlers via `queue.registerBatch`, allowing the queue to process multiple jobs at once according to configurable batch sizes and timing.
9+
- New `batch` configuration options: `minSize`, `maxSize`, and `waitFor` allow fine-grained control over when and how batches are processed.
10+
- Type-safe batch jobs: Batch jobs are strictly separated from scheduled/single jobs and **do not support** cron, delay, or repeat options.
11+
- Adapter API extended: All core adapters now support efficient batch operations.
12+
- Events for batch lifecycle: The queue emits `batch:processing`, `batch:completed`, and `batch:failed` events for batch jobs.
13+
14+
**Handler exclusivity:** A queue can handle only batch jobs or single jobs — not both. Attempting to register both handler types in the same queue will throw an error. This ensures clear and predictable processing.
15+
16+
#### Example
17+
18+
```ts
19+
import { MemoryQueueAdapter, Queue } from "@vorsteh-queue/core"
20+
21+
type EmailPayload = { to: string; body: string }
22+
type EmailResult = { ok: boolean }
23+
24+
const adapter = new MemoryQueueAdapter()
25+
const queue = new Queue<EmailPayload, EmailResult>(adapter, {
26+
name: "batch-demo",
27+
batch: { minSize: 5, maxSize: 20, waitFor: 1000 },
28+
})
29+
30+
queue.registerBatch("send-emails", async (jobs) => {
31+
// jobs is an array of up to 20 jobs
32+
await sendBulkEmails(jobs.map((j) => j.payload))
33+
return jobs.map(() => ({ ok: true }))
34+
})
35+
36+
// Add jobs as usual
37+
await queue.addJobs("send-emails", [
38+
{ to: "[email protected]", body: "Hi A" },
39+
{ to: "[email protected]", body: "Hi B" },
40+
// ...
41+
])
42+
43+
queue.start()
44+
```
45+
46+
### Patch Changes
47+
48+
- 35f7171: update dependencies
49+
350
## 0.3.2
451

552
### Patch Changes

0 commit comments

Comments
 (0)