edgeport - v1.0.3
    Preparing search index...

    Interface NatsSubscription

    An active subscription that yields NatsMessages as they arrive.

    Iterate it with for await; the loop ends when unsubscribe is called or the connection closes. It is an AsyncDisposable, so await using unsubscribes automatically.

    1.0.0

    interface NatsSubscription {
        subject: string;
        "[asyncDispose]"(): PromiseLike<void>;
        "[asyncIterator]"(): AsyncIterator<NatsMessage, any, any>;
        unsubscribe(): Promise<void>;
    }

    Hierarchy

    • AsyncIterable<NatsMessage>
    • AsyncDisposable
      • NatsSubscription
    Index
    subject: string

    The subject this subscription matches.

    • Returns PromiseLike<void>

    • Returns AsyncIterator<NatsMessage, any, any>

    • Stops the subscription (UNSUB) and ends the iterator.

      Returns Promise<void>

      Resolves once the UNSUB is written.