Table of Contents

Method UpdateAndReleaseExclusiveAsync

Namespace
Scaleout.Client
Assembly
Scaleout.Client.dll

UpdateAndReleaseExclusiveAsync(TKey, TValue, LockToken, UpdatePolicy, IEnumerable<string>, CancellationToken)

Updates an existing object in the cache that is already locked by the caller and releases the lock on the object.

public Task<CacheResponse<TKey, TValue>> UpdateAndReleaseExclusiveAsync(TKey key, TValue value, LockToken lockToken, UpdatePolicy updatePolicy = null, IEnumerable<string> tags = null, CancellationToken cancellationToken = default)

Parameters

key TKey

Identifier of the object in the cache.

value TValue

Value to be stored in the cache.

lockToken LockToken

A non-empty lock token that was acquired from an earlier locking call.

updatePolicy UpdatePolicy

Policy changes to make to the object in the ScaleOut service. If null, the policy is left unchanged.

tags IEnumerable<string>

Collection of tags to associate with the object. All tags are replaced with the provided collection. Pass null to leave current tags in place. An empty collection clears current tags.

cancellationToken CancellationToken

A token used to propagate notification that this operation should be canceled.

Returns

Task<CacheResponse<TKey, TValue>>

A CacheResponse<TKey, TValue> containing the outcome of the operation.

Remarks

The Result property of the response will contain one of the following ServerResult outcomes:

ServerResultDescription
UpdatedThe object was successfully updated and unlocked in the ScaleOut service.
NotFoundThe requested object was not found in the ScaleOut service.
LockLostError The exclusive lock on the object was lost (typically due to a lock timeout) and another caller claimed it.