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.

17 lines 599 B
import { _flush } from "./_flush.js"; export const _on_init_response = function on_init_response(ctx, input) { if (!ctx.lastSeqNo) { // Store the last sequence number from the server. ctx.updateLastSeqNo(input.lastSeqNo); } while (ctx.inflight.length > 0) { const message = ctx.inflight.pop(); if (!message) { continue; } ctx.buffer.unshift(message); ctx.updateBufferSize(BigInt(message.data.length)); } _flush(ctx); // Flush the buffer to send any pending messages. }; //# sourceMappingURL=_init_reponse.js.map