Table of Contents

Method CreateAsync

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

CreateAsync<T>(string, T, INatsSerialize<T>?, CancellationToken)

Create a new entry in the bucket only if it doesn't exist

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

Parameters

key string

Key of the entry

value T

Value of the entry

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 entry

Type Parameters

T

Serialized value type