Skip to content

ConfigureAsync Method ​

Definition ​

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

Overloads ​

NameDescription
ValueTask ConfigureAsync(int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null)Updates the admission limits. When maxRequests or timeSpan is reduced, admissions are paused until the active window complies with the new limits.
ValueTask ConfigureAsync(TimeSpan timeout, int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null)Updates the admission limits, waiting at most timeout when a drain is required.

ValueTask ConfigureAsync(int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null) ​

csharp
ValueTask ConfigureAsync(int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null)

Updates the admission limits. When maxRequests or timeSpan is reduced, admissions are paused until the active window complies with the new limits.

Parameters ​

NameDescription
cancellationTokenA token that can be used to cancel the wait.
maxRequestsThe maximum number of requests allowed within the specified time span.
timeSpanThe time span during which the maximum number of requests is allowed.

Returns ​

A task that completes when the new limits are in effect and any required drain has finished.

ValueTask ConfigureAsync(TimeSpan timeout, int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null) ​

csharp
ValueTask ConfigureAsync(TimeSpan timeout, int maxRequests, TimeSpan timeSpan, CancellationToken cancellationToken = null)

Updates the admission limits, waiting at most timeout when a drain is required.

Parameters ​

NameDescription
cancellationTokenA token that can be used to cancel the wait.
maxRequestsThe maximum number of requests allowed within the specified time span.
timeSpanThe time span during which the maximum number of requests is allowed.
timeoutMaximum time to wait for drain. Must be greater than zero.

Returns ​

A task that completes when the new limits are in effect and any required drain has finished.