Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

TypedSubscription

import { TypedSubscription } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.27.0/nats-base-client/internal_mod.ts";

TypedSubscription wraps a subscription to provide payload specific subscription semantics. That is messages are a transport for user data, and the data is presented as application specific data to the client.

class TypedSubscription<T> extends QueuedIteratorImpl<T> implements Sub<T> {
constructor(
subject: string,
);
adapter: MsgAdapter<T>;
get closed(): Promise<void>;
subIterDone: Deferred<void>;
 
callback(e: NatsError | null, msg: Msg): 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;
}

§Type Parameters

§Extends

§
QueuedIteratorImpl<T>
[src]

§Implements

§Constructors

§
new TypedSubscription(nc: NatsConnection, subject: string, opts: TypedSubscriptionOptions<T>)
[src]

§Properties

§
adapter: MsgAdapter<T>
[src]
§
closed: Promise<void> readonly
[src]
§
subIterDone: Deferred<void>
[src]

§Methods

§
callback(e: NatsError | null, msg: Msg): void
[src]
§
drain(): Promise<void>
[src]
§
getID(): number
[src]
§
getMax(): number | undefined
[src]
§
getPending(): number
[src]
§
getProcessed(): number
[src]
§
getReceived(): number
[src]
§
getSubject(): string
[src]
§
isClosed(): boolean
[src]
§
isDraining(): boolean
[src]
§
unsubscribe(max?: number): void
[src]