Table of Contents

Method HistoryAsync

Namespace
NATS.Client.KeyValueStore
Assembly
NATS.Client.KeyValueStore.dll

HistoryAsync<T>(string, INatsDeserialize<T>?, NatsKVWatchOpts?, CancellationToken)

Get the history of an entry by key

IAsyncEnumerable<NatsKVEntry<T>> HistoryAsync<T>(string key, INatsDeserialize<T>? serializer = null, NatsKVWatchOpts? opts = null, CancellationToken cancellationToken = default)

Parameters

key string

Key of the entry

serializer INatsDeserialize<T>

Serializer to use for the message type.

opts NatsKVWatchOpts

Watch options

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

IAsyncEnumerable<NatsKVEntry<T>>

An async enumerable of entries to be used in an await foreach

Type Parameters

T

Serialized value type

Exceptions

InvalidOperationException

There was a conflict in options, e.g. IncludeHistory and UpdatesOnly are only valid when ResumeAtRevision is not set.