Method RemoveOptimisticAsync
RemoveOptimisticAsync(TKey, VersionToken, CancellationToken)
Removes an object from the cache using optimistic concurrency.
public Task<CacheResponse<TKey, TValue>> RemoveOptimisticAsync(TKey key, VersionToken version, CancellationToken cancellationToken = default)
Parameters
key
TKeyIdentifier of the object in the cache.
version
VersionTokenThe version of the object that the caller currently has and intends to remove.
cancellationToken
CancellationTokenA 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:
ServerResult | Description |
---|---|
Removed | The object was successfully removed from the ScaleOut service. |
NotFound | The requested object was not found in the ScaleOut service. |
VersionMismatchError |
The optimistic removal could not be performed because the supplied
version did not match the latest version of the object in the
ScaleOut service. The object should be re-retrieved to get its latest
version prior to retrying the optimistic removal.
|