Method FetchAsync
FetchAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)
Fetch messages from the stream in order.
public IAsyncEnumerable<NatsJSMsg<T>> FetchAsync<T>(NatsJSFetchOpts opts, INatsDeserialize<T>? serializer = null, CancellationToken cancellationToken = default)
Parameters
opts
NatsJSFetchOptsFetch options.
serializer
INatsDeserialize<T>Serializer to use for the message type.
cancellationToken
CancellationTokenA CancellationToken used to cancel fetch operation.
Returns
- IAsyncEnumerable<NatsJSMsg<T>>
Asynchronous enumeration which can be used in a
await foreach
loop.
Type Parameters
T
Serialized message data type.