Skip to content

Releases: noxify/vorsteh-queue

[email protected]

27 Oct 21:01
e94e5a4

Choose a tag to compare

Patch Changes

@vorsteh-queue/[email protected]

27 Oct 21:00
e94e5a4

Choose a tag to compare

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 batch configuration options: minSize, maxSize, and waitFor allow 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, and batch:failed events 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

@vorsteh-queue/[email protected]

27 Oct 21:01
e94e5a4

Choose a tag to compare

Minor Changes

  • b18ec50: Added support for batch processing

Patch Changes

@vorsteh-queue/[email protected]

27 Oct 21:01
e94e5a4

Choose a tag to compare

Minor Changes

  • b18ec50: Added support for batch processing

Patch Changes

@vorsteh-queue/[email protected]

27 Oct 21:01
e94e5a4

Choose a tag to compare

Minor Changes

  • b18ec50: Added support for batch processing

Patch Changes

@vorsteh-queue/[email protected]

04 Sep 15:53
a130581

Choose a tag to compare

Patch Changes

@vorsteh-queue/[email protected]

04 Sep 15:53
a130581

Choose a tag to compare

Patch Changes

@vorsteh-queue/[email protected]

04 Sep 15:53
a130581

Choose a tag to compare

Patch Changes

[email protected]

03 Sep 11:35
ca47778

Choose a tag to compare

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]

03 Sep 10:30
dab74de

Choose a tag to compare

Patch Changes