Releases: noxify/vorsteh-queue
Releases · noxify/vorsteh-queue
[email protected]
Patch Changes
- 35f7171: update dependencies
@vorsteh-queue/[email protected]
Minor Changes
Added
- 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. - New
batchconfiguration options:minSize,maxSize, andwaitForallow fine-grained control over when and how batches are processed. - Type-safe batch jobs: Batch jobs are strictly separated from scheduled/single jobs and do not support cron, delay, or repeat options.
- Adapter API extended: All core adapters now support efficient batch operations.
- Events for batch lifecycle: The queue emits
batch:processing,batch:completed, andbatch:failedevents for batch jobs.
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.
Example
import { MemoryQueueAdapter, Queue } from "@vorsteh-queue/core"
type EmailPayload = { to: string; body: string }
type EmailResult = { ok: boolean }
const adapter = new MemoryQueueAdapter()
const queue = new Queue<EmailPayload, EmailResult>(adapter, {
name: "batch-demo",
batch: { minSize: 5, maxSize: 20, waitFor: 1000 },
})
queue.registerBatch("send-emails", async (jobs) => {
// jobs is an array of up to 20 jobs
await sendBulkEmails(jobs.map((j) => j.payload))
return jobs.map(() => ({ ok: true }))
})
// Add jobs as usual
await queue.addJobs("send-emails", [
{ to: "[email protected]", body: "Hi A" },
{ to: "[email protected]", body: "Hi B" },
// ...
])
queue.start()Patch Changes
- 35f7171: update dependencies
@vorsteh-queue/[email protected]
Minor Changes
- b18ec50: Added support for batch processing
Patch Changes
- 35f7171: update dependencies
- Updated dependencies [66c4848]
- Updated dependencies [35f7171]
- @vorsteh-queue/[email protected]
@vorsteh-queue/[email protected]
Minor Changes
- b18ec50: Added support for batch processing
Patch Changes
- 35f7171: update dependencies
- Updated dependencies [66c4848]
- Updated dependencies [35f7171]
- @vorsteh-queue/[email protected]
@vorsteh-queue/[email protected]
Minor Changes
- b18ec50: Added support for batch processing
Patch Changes
- 35f7171: update dependencies
- Updated dependencies [66c4848]
- Updated dependencies [35f7171]
- @vorsteh-queue/[email protected]
@vorsteh-queue/[email protected]
@vorsteh-queue/[email protected]
Patch Changes
- fef15d5: use shared tests
@vorsteh-queue/[email protected]
Patch Changes
- fef15d5: use shared tests
[email protected]
Patch Changes
-
9543593: use static json list from our own website to fetch the available templates.
This solves the "Rate limit" problem which comes from the GitHub API.
[email protected]
Patch Changes
- 14143bc: fix build issue