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
optsNatsJSFetchOptsFetch options.
serializerINatsDeserialize<T>Serializer to use for the message type.
cancellationTokenCancellationTokenA CancellationToken used to cancel fetch operation.
Returns
- IAsyncEnumerable<NatsJSMsg<T>>
Asynchronous enumeration which can be used in a
await foreachloop.
Type Parameters
TSerialized message data type.