Method PutAsync
- Namespace
- NATS.Client.KeyValueStore
- Assembly
- NATS.Client.KeyValueStore.dll
PutAsync<T>(string, T, INatsSerialize<T>?, CancellationToken)
Put a value into the bucket using the key
public ValueTask<ulong> PutAsync<T>(string key, T value, INatsSerialize<T>? serializer = null, CancellationToken cancellationToken = default)
Parameters
keystringKey of the entry
valueTValue of the entry
serializerINatsSerialize<T>Serializer to use for the message type.
cancellationTokenCancellationTokenA CancellationToken used to cancel the API call.
Returns
Type Parameters
TSerialized value type
PutAsync<T>(string, T, TimeSpan, INatsSerialize<T>?, CancellationToken)
public ValueTask<ulong> PutAsync<T>(string key, T value, TimeSpan ttl = default, INatsSerialize<T>? serializer = null, CancellationToken cancellationToken = default)
Parameters
keystringvalueTttlTimeSpanserializerINatsSerialize<T>cancellationTokenCancellationToken
Returns
Type Parameters
T