Table of Contents

Method RemoveAsync

Namespace
Scaleout.Client
Assembly
Scaleout.Client.dll

RemoveAsync(TKey, CancellationToken)

Removes an object from the cache.

public Task<CacheResponse<TKey, TValue>> RemoveAsync(TKey key, CancellationToken cancellationToken = default)

Parameters

key TKey

Identifier of the object in the cache.

cancellationToken CancellationToken

A 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:

ServerResultDescription
RemovedThe object was successfully removed from the ScaleOut service.
NotFoundThe 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.