Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
class NatsConnectionImpl
implements NatsConnection
import { NatsConnectionImpl } from "https://deno.land/x/natsws@v1.28.0/src/nats-base-client.ts";

Constructors

new
private
NatsConnectionImpl(opts: ConnectionOptions)

Properties

_services: ServicesAPI
draining: boolean
readonly
features: Features
readonly
info: ServerInfo | undefined
listeners: QueuedIterator<Status>[]
protocol: ProtocolHandler
readonly
services: ServicesAPI

Methods

_check(
subject: string,
sub: boolean,
pub: boolean,
)
_resub(
subject: string,
max?: number,
)
closed(): Promise<void | Error>
context(): Promise<Context>
drain(): Promise<void>
flush(): Promise<void>

Flushes to the server. Promise resolves when round-trip completes.

getServer(): string
getServerVersion(): SemVer | undefined
isClosed(): boolean
isDraining(): boolean
jetstream(opts?: JetStreamOptions | JetStreamManagerOptions): JetStreamClient
jetstreamManager(opts?: JetStreamManagerOptions): Promise<JetStreamManager>
publish(
subject: string,
data?: Payload,
options?: PublishOptions,
): void
reconnect(): Promise<void>
request(
subject: string,
data?: Payload,
): Promise<Msg>
requestMany(
subject: string,
data?: Payload,
opts?: Partial<RequestManyOptions>,
): Promise<QueuedIterator<Msg>>
rtt(): Promise<number>
status(): AsyncIterable<Status>
subscribe(subject: string, opts?: SubscriptionOptions): Subscription