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.

54 lines 1.33 kB
export class TopicPartitionSession { /** * Partition session identifier. */ partitionSessionId; /** * Partition identifier. */ partitionId; /** * Topic path. */ topicPath; /** * Partition offsets. */ partitionOffsets = { start: 0n, end: 0n }; /** * Offset of the last committed message from the partition. */ partitionCommittedOffset = 0n; /** * Flag indicating whether the session is currently active. */ #stopped = false; /** * Flag indicating whether the session has ended. */ #ended = false; /** * Creates a new instance of TopicPartitionSession. * @param partitionSessionId - The identifier of the partition session. * @param partitionId - The identifier of the partition. * @param topicPath - The path of the topic. */ constructor(partitionSessionId, partitionId, topicPath) { this.partitionSessionId = partitionSessionId; this.partitionId = partitionId; this.topicPath = topicPath; } get isStopped() { return this.#stopped; } get isEnded() { return this.#ended; } stop() { this.#stopped = true; } end() { this.#ended = true; } } //# sourceMappingURL=partition-session.js.map