PartitionedRateLimiter<TResource> Class

Definition

Represents a limiter type that users interact with to determine if an operation can proceed given a specific TResource.

public abstract class PartitionedRateLimiter<TResource> : IAsyncDisposable, IDisposable
type PartitionedRateLimiter<'Resource> = class
    interface IAsyncDisposable
    interface IDisposable
Public MustInherit Class PartitionedRateLimiter(Of TResource)
Implements IAsyncDisposable, IDisposable

Type Parameters

TResource

The resource type that is being limited.

Inheritance
PartitionedRateLimiter<TResource>
Implements

Constructors

PartitionedRateLimiter<TResource>()

Methods

AcquireAsync(TResource, Int32, CancellationToken)

Wait until the requested permits are available or permits can no longer be acquired.

AcquireAsyncCore(TResource, Int32, CancellationToken)

Method that PartitionedRateLimiter<TResource> implementations implement for AcquireAsync(TResource, Int32, CancellationToken).

AttemptAcquire(TResource, Int32)

Fast synchronous attempt to acquire permits.

AttemptAcquireCore(TResource, Int32)

Method that PartitionedRateLimiter<TResource> implementations implement for AttemptAcquire(TResource, Int32).

Dispose()

Disposes the RateLimiter. This completes any queued acquires with a failed lease.

Dispose(Boolean)

Dispose method for implementations to write.

DisposeAsync()

Disposes the RateLimiter asynchronously.

DisposeAsyncCore()

DisposeAsync method for implementations to write.

GetStatistics(TResource)

Gets a snapshot of the statistics for the resource if available.

WithTranslatedKey<TOuter>(Func<TOuter,TResource>, Boolean)

Translates PartitionedRateLimiter<TOuter> into the current PartitionedRateLimiter<TResource> using the keyAdapter to translate TOuter to TResource.

Applies to