Class RateLimiterStrategyOptions
- Namespace
- Polly.RateLimiting
- Assembly
- Polly.RateLimiting.dll
Options for the rate limiter strategy.
public class RateLimiterStrategyOptions : ResilienceStrategyOptions
- Inheritance
-
RateLimiterStrategyOptions
- Inherited Members
Constructors
RateLimiterStrategyOptions()
Initializes a new instance of the RateLimiterStrategyOptions class.
public RateLimiterStrategyOptions()
Properties
DefaultRateLimiterOptions
Gets or sets the default rate limiter options.
[Required]
public ConcurrencyLimiterOptions DefaultRateLimiterOptions { get; set; }
Property Value
Remarks
The options for the default limiter that will be used when RateLimiter is null.
PermitLimit defaults to 1000. QueueLimit defaults to 0.
OnRejected
Gets or sets an event that is raised when the execution of user-provided callback is rejected by the rate limiter.
public Func<OnRateLimiterRejectedArguments, ValueTask>? OnRejected { get; set; }
Property Value
- Func<OnRateLimiterRejectedArguments, ValueTask>
The default value is null.
RateLimiter
Gets or sets a rate limiter delegate that produces RateLimitLease.
public Func<RateLimiterArguments, ValueTask<RateLimitLease>>? RateLimiter { get; set; }
Property Value
- Func<RateLimiterArguments, ValueTask<RateLimitLease>>
The default value is null. If this property is null, then the strategy will use a ConcurrencyLimiter created using DefaultRateLimiterOptions.