Method ListConsumersAsync
ListConsumersAsync(CancellationToken)
Enumerates through consumers that belong to this stream.
public IAsyncEnumerable<INatsJSConsumer> ListConsumersAsync(CancellationToken cancellationToken = default)Parameters
- cancellationTokenCancellationToken
- A CancellationToken used to cancel the API call. 
Returns
- IAsyncEnumerable<INatsJSConsumer>
- Async enumerable of consumer objects. Can be used in a - await foreachloop.
Exceptions
- NatsJSException
- There is an error retrieving the response or this consumer object isn't valid anymore because it was deleted earlier. 
- NatsJSApiException
- Server responded with an error.