import { type Sub } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";
Basic interface to a Subscription type
Methods
Stop the subscription from receiving messages. You can optionally specify that the subscription should stop after the specified number of messages have been received. Note this count is since the lifetime of the subscription.
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.
Returns the number of messages that are pending processing. Note that this is method is only valid for iterators.