Share via


PartitionedRateLimiter<TResource>.AcquireAsyncCore Method

Definition

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

Parameters

resource
TResource

The resource to limit.

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