Sub
import type { Sub } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.28.2/nats-base-client/internal_mod.ts";
Basic interface to a Subscription type
interface Sub <T> extends AsyncIterable<T> {
closed: Promise<void>;
drain(): Promise<void>;
getID(): number;
getMax(): number | undefined;
getPending(): number;
getProcessed(): number;
getReceived(): number;
getSubject(): string;
isClosed(): boolean;
isDraining(): boolean;
unsubscribe(max?: number): void;
}§Methods
§
drain(): Promise<void>
[src]Drain the subscription, closing it after processing all messages currently in flight for the client. Returns a promise that resolves when the subscription finished draining.
§
getMax(): number | undefined
[src]Return the max number of messages before the subscription will unsubscribe.
§
getPending(): number
[src]Returns the number of messages that are pending processing. Note that this is method is only valid for iterators.