Table of Contents

Method JSRequestResponseAsync

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll

JSRequestResponseAsync<TRequest, TResponse>(string, TRequest?, CancellationToken)

Sends a request message to a JetStream subject and waits for a response.

public ValueTask<TResponse> JSRequestResponseAsync<TRequest, TResponse>(string subject, TRequest? request, CancellationToken cancellationToken = default) where TRequest : class where TResponse : class

Parameters

subject string

The JetStream API subject to send the request to.

request TRequest

The request message object.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<TResponse>

A task representing the asynchronous operation, with a result of type TResponse.

Type Parameters

TRequest

The type of the request message.

TResponse

The type of the response message.