Interface NatsSubscriptionType

interface NatsSubscriptionType {
    isClosed: boolean;
    queue?: string;
    subject: string;
    [asyncIterator](): AsyncIterableIterator<NatsJsMsg>;
    drain(): Promise<void>;
    unsubscribe(): void;
}

Properties

isClosed: boolean

Indicates whether this subscription is currently active.

queue?: string

The queue group this subscription belongs to, if any.

subject: string

The subject this subscription is listening to.

Methods

  • Drains the subscription, ensuring all pending messages are delivered before unsubscribing.

    Returns Promise<void>

    Promise

  • Unsubscribes from the subject, stopping message delivery.

    Returns void