Table of Contents

Method ReplyAsync

Namespace
NATS.Client.Services
Assembly
NATS.Client.Services.dll

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

Send a reply with an empty message body.

public ValueTask ReplyAsync(NatsHeaders? headers = null, string? replyTo = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

headers NatsHeaders

Optional message headers.

replyTo string

Optional reply-to subject.

opts NatsPubOpts

Optional publishing options.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask

A ValueTask representing the asynchronous operation.

ReplyAsync<TReply>(TReply, NatsHeaders?, string?, INatsSerialize<TReply>?, NatsPubOpts?, CancellationToken)

Send a reply with a message body.

public ValueTask ReplyAsync<TReply>(TReply data, NatsHeaders? headers = null, string? replyTo = null, INatsSerialize<TReply>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

data TReply

Data to be sent.

headers NatsHeaders

Optional message headers.

replyTo string

Optional reply-to subject.

serializer INatsSerialize<TReply>

Serializer to use for the message type.

opts NatsPubOpts

Optional publishing options.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask

A ValueTask representing the asynchronous operation.

Type Parameters

TReply

A serializable type as data.