import { S as Storage } from "../packem_shared/unstorage.DqlWKU2I.d-CogP3Etw.js"; import { a as NotificationMessage } from "../packem_shared/notification.d-D0ado_cy.js"; import { Q as QueueJob, N as NotificationQueue } from "../packem_shared/types.d-r8K0ICyx.js"; import "../packem_shared/types.d-CRs03TYV.js"; import "../packem_shared/types.d-C7l7qdMG.js"; import "../packem_shared/provider.d-Dh32nRm9.js"; /** * A {@link NotificationQueue} backed by an [unstorage](https://unstorage.unjs.io) driver, * giving durable, multi-backend persistence (Redis, filesystem, KV, ...). `unstorage` is * an optional peer dependency — pass a configured `Storage` instance. * * Each job is a single self-contained document keyed by the configured prefix followed by `:job:` and the job id; * there is no shared pending index, so concurrent `enqueue`s cannot lose-update each other. * `reserve` scans the job documents under the prefix for the next due, unreserved job and * marks it reserved. Individual reads/writes are still not transactional, so two workers * racing `reserve` on the *same* job can both take it (double delivery); for that level of * contention prefer a store with atomic guarantees, or reserve from one instance. */ declare class UnstorageQueue implements NotificationQueue { #private; constructor(storage: Storage, prefix?: string); enqueue(message: NotificationMessage, options?: { scheduledAt?: number; }): Promise; reserve(): Promise; ack(id: string): Promise; retry(id: string, delayMs?: number): Promise; size(): Promise; } /** * Convenience factory for {@link UnstorageQueue}. * @param storage A configured unstorage `Storage` instance. * @param prefix Key prefix under which jobs are stored. * @returns A new {@link UnstorageQueue}. */ declare const createUnstorageQueue: (storage: Storage, prefix?: string) => UnstorageQueue; export { UnstorageQueue, createUnstorageQueue };