UNPKG

@arturwojnar/hermes-postgresql

Version:

Production-Ready TypeScript Outbox Pattern for PostgreSQL

10 lines (9 loc) 670 B
import { Duration } from '@arturwojnar/hermes'; import { Transaction } from '../subscribeToReplicationSlot/types.js'; import { MessageToPublish, PublishingQueue } from './publishingQueue.js'; type PublishingQueueOptions<InsertResult> = { waitAfterFailedPublish?: Duration; onFailedPublish?: (tx: Transaction<InsertResult>) => Promise<void>; }; declare const createSerializedPublishingQueue: <InsertResult>(publish: (messageToPublish: MessageToPublish<InsertResult>) => Promise<void>, options?: PublishingQueueOptions<InsertResult>) => PublishingQueue<"SerializedPublishingQueue", InsertResult>; export { createSerializedPublishingQueue, type MessageToPublish };