Table of Contents

Method NextAsync

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

NextAsync<T>(INatsDeserialize<T>?, NatsJSNextOpts?, CancellationToken)

Consume a single message using a pull subscription on this consumer.

public ValueTask<INatsJSMsg<T>?> NextAsync<T>(INatsDeserialize<T>? serializer = null, NatsJSNextOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

serializer INatsDeserialize<T>
opts NatsJSNextOpts
cancellationToken CancellationToken

Returns

ValueTask<INatsJSMsg<T>>

Type Parameters

T

Message type to deserialize.

Remarks

Push consumers don't support this operation.

Exceptions

NatsJSProtocolException

Consumer is push based.