Method ListConsumersAsync
ListConsumersAsync(string, CancellationToken)
Enumerates through consumers belonging to a stream.
public IAsyncEnumerable<INatsJSConsumer> ListConsumersAsync(string stream, CancellationToken cancellationToken = default)
Parameters
stream
stringStream name the consumers belong to.
cancellationToken
CancellationTokenA CancellationToken used to cancel the API call.
Returns
- IAsyncEnumerable<INatsJSConsumer>
Async enumerable of consumer info objects. Can be used in a
await foreach
loop.
Exceptions
- NatsJSException
There was an issue retrieving the response.
- NatsJSApiException
Server responded with an error.
- ArgumentException
The
stream
name is invalid.- ArgumentNullException
The
stream
name isnull
.