Table of Contents

Interface INatsClient

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll
public interface INatsClient : IAsyncDisposable
Inherited Members

Properties

Connection

Represents a connection to the NATS server.

Methods

ConnectAsync()

Connect socket and write CONNECT command to nats server.

PingAsync(CancellationToken)

Send PING command and await PONG. Return value is similar as Round Trip Time (RTT).

PublishAsync(string, NatsHeaders?, string?, NatsPubOpts?, CancellationToken)

Publishes an empty message payload to the given subject name, optionally supplying a reply subject.

PublishAsync<T>(string, T, NatsHeaders?, string?, INatsSerialize<T>?, NatsPubOpts?, CancellationToken)

Publishes a serializable message payload to the given subject name, optionally supplying a reply subject.

RequestAsync<TReply>(string, INatsDeserialize<TReply>?, NatsSubOpts?, CancellationToken)

Send an empty request message and await the reply message asynchronously.

RequestAsync<TRequest, TReply>(string, TRequest?, NatsHeaders?, INatsSerialize<TRequest>?, INatsDeserialize<TReply>?, NatsPubOpts?, NatsSubOpts?, CancellationToken)

Request and receive a single reply from a responder.

SubscribeAsync<T>(string, string?, INatsDeserialize<T>?, NatsSubOpts?, CancellationToken)

Initiates a subscription to a subject, optionally joining a distributed queue group.