Share via


IReliableDictionary<TKey,TValue>.ClearAsync Method

Definition

Removes all keys and values from the Reliable Dictionary.

public System.Threading.Tasks.Task ClearAsync (TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
abstract member ClearAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function ClearAsync (timeout As TimeSpan, cancellationToken As CancellationToken) As Task

Parameters

timeout
TimeSpan

The amount of time to wait for the operation to complete before throwing a TimeoutException. Primarily used to prevent deadlocks. The default is 4 seconds.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default is None.

Returns

Task that represents the asynchronous clear operation.

Exceptions

timeout is negative.

The operation failed to complete within the given timeout.

The operation was canceled.

The exception that is thrown when the IReliableDictionary<TKey,TValue> is not in Primary.

Applies to