Class ShieldRateLimiterExtensions

Namespace
Kevlar.Extensions.RateLimiting
Assembly
Kevlar.Extensions.RateLimiting.dll

Adds System.Threading.RateLimiting-backed strategies to Kevlar shields.

public static class ShieldRateLimiterExtensions
Inheritance
ShieldRateLimiterExtensions
Inherited Members

Methods

UseRateLimiter(Shield, RateLimitLeaseAcquirer, Action<RateLimiterAdapterOptions>?)

Appends a strategy backed by caller-provided asynchronous lease acquisition.

public static Shield UseRateLimiter(this Shield shield, RateLimitLeaseAcquirer acquireLease, Action<RateLimiterAdapterOptions>? configure = null)

Parameters

shield Shield
acquireLease RateLimitLeaseAcquirer
configure Action<RateLimiterAdapterOptions>

Returns

Shield

UseRateLimiter(Shield, PartitionedRateLimiter<KevlarContext>, Action<RateLimiterAdapterOptions>?, bool)

Appends a strategy backed by a context-aware limiter.

public static Shield UseRateLimiter(this Shield shield, PartitionedRateLimiter<KevlarContext> limiter, Action<RateLimiterAdapterOptions>? configure = null, bool ownsLimiter = false)

Parameters

shield Shield
limiter PartitionedRateLimiter<KevlarContext>
configure Action<RateLimiterAdapterOptions>
ownsLimiter bool

Returns

Shield

UseRateLimiter(Shield, RateLimiter, Action<RateLimiterAdapterOptions>?, bool)

Appends a strategy backed by limiter.

public static Shield UseRateLimiter(this Shield shield, RateLimiter limiter, Action<RateLimiterAdapterOptions>? configure = null, bool ownsLimiter = false)

Parameters

shield Shield
limiter RateLimiter
configure Action<RateLimiterAdapterOptions>
ownsLimiter bool

Returns

Shield

UseRateLimiter<TResult>(Shield<TResult>, RateLimitLeaseAcquirer, Action<RateLimiterAdapterOptions>?)

Appends a strategy backed by caller-provided asynchronous lease acquisition.

public static Shield<TResult> UseRateLimiter<TResult>(this Shield<TResult> shield, RateLimitLeaseAcquirer acquireLease, Action<RateLimiterAdapterOptions>? configure = null)

Parameters

shield Shield<TResult>
acquireLease RateLimitLeaseAcquirer
configure Action<RateLimiterAdapterOptions>

Returns

Shield<TResult>

Type Parameters

TResult

UseRateLimiter<TResult>(Shield<TResult>, PartitionedRateLimiter<KevlarContext>, Action<RateLimiterAdapterOptions>?, bool)

Appends a strategy backed by a context-aware limiter.

public static Shield<TResult> UseRateLimiter<TResult>(this Shield<TResult> shield, PartitionedRateLimiter<KevlarContext> limiter, Action<RateLimiterAdapterOptions>? configure = null, bool ownsLimiter = false)

Parameters

shield Shield<TResult>
limiter PartitionedRateLimiter<KevlarContext>
configure Action<RateLimiterAdapterOptions>
ownsLimiter bool

Returns

Shield<TResult>

Type Parameters

TResult

UseRateLimiter<TResult>(Shield<TResult>, RateLimiter, Action<RateLimiterAdapterOptions>?, bool)

Appends a strategy backed by limiter.

public static Shield<TResult> UseRateLimiter<TResult>(this Shield<TResult> shield, RateLimiter limiter, Action<RateLimiterAdapterOptions>? configure = null, bool ownsLimiter = false)

Parameters

shield Shield<TResult>
limiter RateLimiter
configure Action<RateLimiterAdapterOptions>
ownsLimiter bool

Returns

Shield<TResult>

Type Parameters

TResult