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
public IAsyncEnumerable<NatsKVEntry<T>> HistoryAsync<T>(string key, INatsDeserialize<T>? serializer = null, NatsKVWatchOpts? opts = null, CancellationToken cancellationToken = default)
Parameters
key
stringKey of the entry
serializer
INatsDeserialize<T>Serializer to use for the message type.
opts
NatsKVWatchOptsWatch options
cancellationToken
CancellationTokenA 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.