Skip to content

DrainAsync Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.Concurrency.dll

Overloads ​

NameDescription
ValueTask DrainAsync(CancellationToken cancellationToken = null)Asynchronously waits until all admitted requests have expired from the active window.
ValueTask DrainAsync(TimeSpan timeout, CancellationToken cancellationToken = null)Asynchronously waits until all admitted requests have expired from the active window or until timeout elapses.

ValueTask DrainAsync(CancellationToken cancellationToken = null) ​

csharp
ValueTask DrainAsync(CancellationToken cancellationToken = null)

Asynchronously waits until all admitted requests have expired from the active window.

Parameters ​

NameDescription
cancellationTokenA token that can be used to cancel the wait.

Returns ​

A task that completes when the active window is empty.

ValueTask DrainAsync(TimeSpan timeout, CancellationToken cancellationToken = null) ​

csharp
ValueTask DrainAsync(TimeSpan timeout, CancellationToken cancellationToken = null)

Asynchronously waits until all admitted requests have expired from the active window or until timeout elapses.

Parameters ​

NameDescription
cancellationTokenA token that can be used to cancel the wait.
timeoutMaximum time to wait. Must be greater than zero.

Returns ​

A task that completes when the active window is empty.