Table of Contents

Method FetchNoWaitAsync

Namespace
NATS.Client.JetStream
Assembly
NATS.Client.JetStream.dll

FetchNoWaitAsync<T>(NatsJSFetchOpts, INatsDeserialize<T>?, CancellationToken)

Consume a set number of messages using a pull subscription on this consumer without waiting.

public IAsyncEnumerable<INatsJSMsg<T>> FetchNoWaitAsync<T>(NatsJSFetchOpts opts, INatsDeserialize<T>? serializer = null, CancellationToken cancellationToken = default)

Parameters

opts NatsJSFetchOpts
serializer INatsDeserialize<T>
cancellationToken CancellationToken

Returns

IAsyncEnumerable<INatsJSMsg<T>>

Type Parameters

T

Message type to deserialize.

Remarks

Push consumers don't support this operation.

Exceptions

NatsJSProtocolException

Consumer is push based.