Dela via


RateLimiter.AcquireAsyncCore(Int32, CancellationToken) Method

Definition

Method that RateLimiter implementations implement for AcquireAsync(Int32, CancellationToken).

protected abstract System.Threading.Tasks.ValueTask<System.Threading.RateLimiting.RateLimitLease> AcquireAsyncCore (int permitCount, System.Threading.CancellationToken cancellationToken);
abstract member AcquireAsyncCore : int * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Threading.RateLimiting.RateLimitLease>
Protected MustOverride Function AcquireAsyncCore (permitCount As Integer, cancellationToken As CancellationToken) As ValueTask(Of RateLimitLease)

Parameters

permitCount
Int32

Number of permits to try and acquire.

cancellationToken
CancellationToken

Optional token to allow canceling a queued request for permits.

Returns

A task that completes when the requested permits are acquired or when the requested permits are denied.

Applies to