Appearance
DrainAsync Method
Definition
- Namespace:
JASE - Assembly:
JASE.Concurrency.dll
Overloads
| Name | Description |
|---|---|
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
| Name | Description |
|---|---|
cancellationToken | A 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
| Name | Description |
|---|---|
cancellationToken | A token that can be used to cancel the wait. |
timeout | Maximum time to wait. Must be greater than zero. |
Returns
A task that completes when the active window is empty.