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
shieldShieldacquireLeaseRateLimitLeaseAcquirerconfigureAction<RateLimiterAdapterOptions>
Returns
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
shieldShieldlimiterPartitionedRateLimiter<KevlarContext>configureAction<RateLimiterAdapterOptions>ownsLimiterbool
Returns
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
shieldShieldlimiterRateLimiterconfigureAction<RateLimiterAdapterOptions>ownsLimiterbool
Returns
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
shieldShield<TResult>acquireLeaseRateLimitLeaseAcquirerconfigureAction<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
shieldShield<TResult>limiterPartitionedRateLimiter<KevlarContext>configureAction<RateLimiterAdapterOptions>ownsLimiterbool
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
shieldShield<TResult>limiterRateLimiterconfigureAction<RateLimiterAdapterOptions>ownsLimiterbool
Returns
- Shield<TResult>
Type Parameters
TResult