Method JSRequestResponseAsync
JSRequestResponseAsync<TRequest, TResponse>(string, TRequest?, CancellationToken)
Sends a request message to a JetStream subject and waits for a response.
ValueTask<TResponse> JSRequestResponseAsync<TRequest, TResponse>(string subject, TRequest? request, CancellationToken cancellationToken = default) where TRequest : class where TResponse : class
Parameters
subjectstringThe JetStream API subject to send the request to.
requestTRequestThe request message object.
cancellationTokenCancellationTokenA CancellationToken used to cancel the API call.
Returns
- ValueTask<TResponse>
A task representing the asynchronous operation, with a result of type
TResponse.
Type Parameters
TRequestThe type of the request message.
TResponseThe type of the response message.