PartitionedRateLimiter<TResource>.AcquireAsyncCore Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Method that PartitionedRateLimiter<TResource> implementations implement for AcquireAsync(TResource, Int32, CancellationToken).
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.