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
keystringKey of the entry
valueTValue of the entry
revisionulongLast revision number to match
serializerINatsSerialize<T>Serializer to use for the message type.
cancellationTokenCancellationTokenA CancellationToken used to cancel the API call.
Returns
Type Parameters
TSerialized value type
UpdateAsync<T>(string, T, ulong, TimeSpan, 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, TimeSpan ttl = default, INatsSerialize<T>? serializer = null, CancellationToken cancellationToken = default)
Parameters
keystringKey of the entry
valueTValue of the entry
revisionulongLast revision number to match
ttlTimeSpanTime to live for the entry (requires the LimitMarkerTTL to be set to true). For a key that should never expire, use the MaxValue constant. This feature is only available on NATS server v2.11 and later.
serializerINatsSerialize<T>Serializer to use for the message type.
cancellationTokenCancellationTokenA CancellationToken used to cancel the API call.
Returns
Type Parameters
TSerialized value type