Table of Contents

Method NextAsync

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

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

Get the next message from the stream in order.

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

Parameters

serializer INatsDeserialize<T>

Serializer to use for the message type.

opts NatsJSNextOpts

Next options.

cancellationToken CancellationToken

A CancellationToken used to cancel the underlying fetch operation.

Returns

ValueTask<NatsJSMsg<T>?>

The next NATS JetStream message in order.

Type Parameters

T

Serialized message data type.