Table of Contents

Method UpdateAsync

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

UpdateAsync<T>(string, T, ulong, INatsSerialize<T>?, CancellationToken)

Update an entry in the bucket only if last update revision matches

public ValueTask<ulong> UpdateAsync<T>(string key, T value, ulong revision, INatsSerialize<T>? serializer = null, CancellationToken cancellationToken = default)

Parameters

key string

Key of the entry

value T

Value of the entry

revision ulong

Last revision number to match

serializer INatsSerialize<T>

Serializer to use for the message type.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.

Returns

ValueTask<ulong>

The revision number of the updated entry

Type Parameters

T

Serialized value type

UpdateAsync<T>(string, T, ulong, TimeSpan, INatsSerialize<T>?, CancellationToken)

public ValueTask<ulong> UpdateAsync<T>(string key, T value, ulong revision, TimeSpan ttl = default, INatsSerialize<T>? serializer = null, CancellationToken cancellationToken = default)

Parameters

key string
value T
revision ulong
ttl TimeSpan
serializer INatsSerialize<T>
cancellationToken CancellationToken

Returns

ValueTask<ulong>

Type Parameters

T