Method ListConsumerNamesAsync
ListConsumerNamesAsync(string, CancellationToken)
Enumerates through consumer names belonging to a stream.
public IAsyncEnumerable<string> ListConsumerNamesAsync(string stream, CancellationToken cancellationToken = default)
Parameters
stream
stringStream name the consumers belong to.
cancellationToken
CancellationTokenA CancellationToken used to cancel the API call.
Returns
- IAsyncEnumerable<string>
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
.