Method TryPutAsync
- Namespace
- NATS.Client.KeyValueStore
- Assembly
- NATS.Client.KeyValueStore.dll
TryPutAsync<T>(string, T, INatsSerialize<T>?, CancellationToken)
Tries to put a value into the bucket using the key
ValueTask<NatsResult<ulong>> TryPutAsync<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
- ValueTask<NatsResult<ulong>>
Revision number
Type Parameters
TSerialized value type
Remarks
Use this method to avoid exceptions