Method RemoveAsync
RemoveAsync(TKey, CancellationToken)
Removes an object from the cache.
public Task<CacheResponse<TKey, TValue>> RemoveAsync(TKey key, CancellationToken cancellationToken = default)
Parameters
key
TKeyIdentifier of the object in the cache.
cancellationToken
CancellationTokenA token used to propagate notification that this operation should be canceled.
Returns
- Task<CacheResponse<TKey, TValue>>
A CacheResponse whose Result property indicates whether the object was removed or did not exist.
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. |
This operation does not use locking and will bypass locks on objects held by other clients/threads.