export { BullMqQueue, createBullMqQueue } from "./bullmq-queue.js"; import { a as NotificationMessage, N as Notification } from "../packem_shared/notification.d-D0ado_cy.js"; import { Q as QueueJob, N as NotificationQueue } from "../packem_shared/types.d-r8K0ICyx.js"; export { PgBossQueue, type PgBossQueueOptions, createPgBossQueue } from "./pg-boss-queue.js"; export { SqsQueue, type SqsQueueOptions, createSqsQueue } from "./sqs-queue.js"; import { c as Receipt } from "../packem_shared/types.d-C7l7qdMG.js"; import "../packem_shared/types.d-CRs03TYV.js"; import "../packem_shared/provider.d-Dh32nRm9.js"; /** * In-process {@link NotificationQueue}. Suitable for single-instance apps, tests and the * default worker; swap for the unstorage/BullMQ adapters for durability. */ declare class MemoryQueue implements NotificationQueue { #private; enqueue(message: NotificationMessage, options?: { scheduledAt?: number; }): string; reserve(): QueueJob | undefined; ack(id: string): void; retry(id: string, delayMs?: number): void; size(): number; } interface QueueWorkerOptions { /** Backoff in ms given the attempt count (default exponential: 1s, 2s, 4s...). */ backoff?: (attempt: number) => number; /** Maximum delivery attempts before a job is dropped (default 5). */ maxAttempts?: number; /** Called when a job is dropped after exhausting attempts. */ onDrop?: (job: QueueJob, receipts: Receipt[]) => void; /** Called when the queue or a delivery throws; the loop keeps polling. */ onError?: (error: unknown, job?: QueueJob) => void; /** Poll interval in ms when the queue is empty (default 1000). */ pollInterval?: number; } interface QueueWorker { /** Processes all currently-due jobs, then resolves. */ drain: () => Promise; /** Starts the polling loop. */ start: () => void; /** Stops the polling loop. */ stop: () => void; } /** * Creates a worker that reserves jobs from a queue and delivers them via a * {@link Notification} facade, retrying with backoff and dropping after `maxAttempts`. * @param queue The queue to drain. * @param notification The facade used to deliver messages. * @param options Behaviour tuning (max attempts, backoff curve, poll interval, drop hook). * @returns A controllable worker. */ declare const createQueueWorker: (queue: NotificationQueue, notification: Notification, options?: QueueWorkerOptions) => QueueWorker; export { MemoryQueue, type NotificationQueue, type QueueJob, type QueueWorker, type QueueWorkerOptions, createQueueWorker };