UNPKG

@ydbjs/topic

Version:

YDB Topics client for publish-subscribe messaging. Provides at-least-once delivery, exactly-once publishing, FIFO guarantees, and scalable message processing for unstructured data.

31 lines 920 B
/** * Sequence Number Manager for TopicWriter * * Handles two modes: * 1. Auto mode: Automatically generates sequential seqNo starting from lastSeqNo + 1 * 2. Manual mode: User provides all seqNo values, validates they are strictly increasing */ export declare class SeqNoManager { #private; constructor(initialSeqNo?: bigint); /** * Initialize with server's last seqNo from STREAM_INIT_RESPONSE */ initialize(serverLastSeqNo: bigint): void; /** * Get next sequence number for a message * @param userSeqNo Optional user-provided seqNo * @returns Final seqNo to use for the message */ getNext(userSeqNo?: bigint): bigint; /** * Get current state */ getState(): { mode: "auto" | "manual" | null; nextSeqNo: bigint; lastSeqNo: bigint; highestUserSeqNo: bigint; }; } //# sourceMappingURL=seqno-manager.d.ts.map