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

ProtocolHandler

import { ProtocolHandler } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.28.2/nats-base-client/internal_mod.ts";
class ProtocolHandler implements Dispatcher<ParserEvent> {
constructor(options: ConnectionOptions, publisher: Publisher);
_closed: boolean;
abortReconnect: boolean;
closed: Deferred<Error | void>;
connected: boolean;
connectedOnce: boolean;
connectError?: (err?: Error) => void;
connectPromise: Promise<void> | null;
features: Features;
heartbeats: Heartbeat;
inBytes: number;
info?: ServerInfo;
infoReceived: boolean;
inMsgs: number;
lastError?: NatsError;
listeners: QueuedIterator<Status>[];
muxSubscriptions: MuxSubscription;
noMorePublishing: boolean;
outbound: DataBuffer;
outBytes: number;
outMsgs: number;
parser: Parser;
pendingLimit: number;
pongs: Array<Deferred<void>>;
publisher: Publisher;
server: ServerImpl;
servers: Servers;
subscriptions: Subscriptions;
transport: Transport;
whyClosed: string;
 
private async _close(err?: Error): Promise<void>;
private flushPending();
private initMux(): void;
private prepare(): Deferred<void>;
private selectServer(): ServerImpl | undefined;
async _doDial(srv: Server): Promise<void>;
_sub(s: SubscriptionImpl): void;
_subunsub(s: SubscriptionImpl);
close(): Promise<void>;
async dial(srv: Server): Promise<void>;
dialLoop(): Promise<void>;
public disconnect(): void;
async disconnected(err?: Error): Promise<void>;
dispatchStatus(status: Status): void;
async dodialLoop(): Promise<void>;
drain(): Promise<void>;
flush(p?: Deferred<void>): Promise<void>;
getServer(): ServerImpl | undefined;
handleAuthError(err: NatsError);
handleError(err: NatsError);
isClosed(): boolean;
processError(m: Uint8Array);
processInfo(m: Uint8Array);
processMsg(msg: MsgArg, data: Uint8Array);
processPing();
processPong();
publish(
subject: string,
payload?: Payload,
options?: PublishOptions,
);
push(e: ParserEvent): void;
public reconnect(): Promise<void>;
request(r: Request): Request;
resetOutbound(): void;
resub(s: SubscriptionImpl, subject: string);
sendCommand(cmd: string | Uint8Array, ...payloads: Uint8Array[]);
sendSubscriptions();
status(): AsyncIterable<Status>;
unsub(s: SubscriptionImpl, max?: number);
unsubscribe(s: SubscriptionImpl, max?: number);
 
static public async connect(options: ConnectionOptions, publisher: Publisher): Promise<ProtocolHandler>;
static toError(s: string);
}

§Implements

§Constructors

§
new ProtocolHandler(options: ConnectionOptions, publisher: Publisher)
[src]

§Properties

§
_closed: boolean
[src]
§
abortReconnect: boolean
[src]
§
closed: Deferred<Error | void>
[src]
§
connected: boolean
[src]
§
connectedOnce: boolean
[src]
§
connectError: (err?: Error) => void
[src]
§
connectPromise: Promise<void> | null
[src]
§
features: Features
[src]
§
heartbeats: Heartbeat
[src]
§
inBytes: number
[src]
§
infoReceived: boolean
[src]
§
inMsgs: number
[src]
§
lastError: NatsError
[src]
§
muxSubscriptions: MuxSubscription
[src]
§
noMorePublishing: boolean
[src]
§
outBytes: number
[src]
§
outMsgs: number
[src]
§
pendingLimit: number
[src]
§
pongs: Array<Deferred<void>>
[src]
§
publisher: Publisher
[src]
§
server: ServerImpl
[src]
§
servers: Servers
[src]
§
subscriptions: Subscriptions
[src]
§
transport: Transport
[src]
§
whyClosed: string
[src]

§Methods

§
_close(err?: Error): Promise<void> private
[src]
§
flushPending() private
[src]
§
initMux(): void private
[src]
§
prepare(): Deferred<void> private
[src]
§
selectServer(): ServerImpl | undefined private
[src]
§
_doDial(srv: Server): Promise<void>
[src]
§
close(): Promise<void>
[src]
§
dial(srv: Server): Promise<void>
[src]
§
dialLoop(): Promise<void>
[src]
§
disconnect(): void
[src]
§
disconnected(err?: Error): Promise<void>
[src]
§
dispatchStatus(status: Status): void
[src]
§
dodialLoop(): Promise<void>
[src]
§
drain(): Promise<void>
[src]
§
flush(p?: Deferred<void>): Promise<void>
[src]
§
getServer(): ServerImpl | undefined
[src]
§
handleAuthError(err: NatsError)
[src]
§
handleError(err: NatsError)
[src]
§
isClosed(): boolean
[src]
§
processError(m: Uint8Array)
[src]
§
processInfo(m: Uint8Array)
[src]
§
processMsg(msg: MsgArg, data: Uint8Array)
[src]
§
processPing()
[src]
§
processPong()
[src]
§
publish(subject: string, payload?: Payload, options?: PublishOptions)
[src]
§
push(e: ParserEvent): void
[src]
§
reconnect(): Promise<void>
[src]
§
request(r: Request): Request
[src]
§
resetOutbound(): void
[src]
§
resub(s: SubscriptionImpl, subject: string)
[src]
§
sendCommand(cmd: string | Uint8Array, ...payloads: Uint8Array[])
[src]
§
sendSubscriptions()
[src]
§
status(): AsyncIterable<Status>
[src]
§
unsub(s: SubscriptionImpl, max?: number)
[src]
§
unsubscribe(s: SubscriptionImpl, max?: number)
[src]

§Static Methods

§
connect(options: ConnectionOptions, publisher: Publisher): Promise<ProtocolHandler>
[src]
§
toError(s: string)
[src]