Class RateLimiterResiliencePipelineBuilderExtensions
- Namespace
- Polly
- Assembly
- Polly.RateLimiting.dll
Extensions for adding rate limiting to ResiliencePipelineBuilder.
public static class RateLimiterResiliencePipelineBuilderExtensions
- Inheritance
-
RateLimiterResiliencePipelineBuilderExtensions
- Inherited Members
Methods
AddConcurrencyLimiter<TBuilder>(TBuilder, int, int)
Adds the concurrency limiter.
public static TBuilder AddConcurrencyLimiter<TBuilder>(this TBuilder builder, int permitLimit, int queueLimit = 0) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
permitLimit
intMaximum number of permits that can be leased concurrently.
queueLimit
intMaximum number of permits that can be queued concurrently.
Returns
- TBuilder
The builder instance with the concurrency limiter added.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
is null.- ValidationException
Thrown when the options constructed from the arguments are invalid.
- ArgumentException
Thrown when
permitLimit
orqueueLimit
is invalid.
AddConcurrencyLimiter<TBuilder>(TBuilder, ConcurrencyLimiterOptions)
Adds the concurrency limiter.
public static TBuilder AddConcurrencyLimiter<TBuilder>(this TBuilder builder, ConcurrencyLimiterOptions options) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
options
ConcurrencyLimiterOptionsThe concurrency limiter options.
Returns
- TBuilder
The builder instance with the concurrency limiter added.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when the options constructed from the arguments are invalid.
- ArgumentException
Thrown when
options
are invalid.
AddRateLimiter<TBuilder>(TBuilder, RateLimiterStrategyOptions)
Adds the rate limiter.
public static TBuilder AddRateLimiter<TBuilder>(this TBuilder builder, RateLimiterStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
options
RateLimiterStrategyOptionsThe rate limiter options.
Returns
- TBuilder
The builder instance with the rate limiter added.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when
options
are invalid.- ArgumentException
Thrown when DefaultRateLimiterOptions for
options
are invalid.
AddRateLimiter<TBuilder>(TBuilder, RateLimiter)
Adds the rate limiter.
public static TBuilder AddRateLimiter<TBuilder>(this TBuilder builder, RateLimiter limiter) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
limiter
RateLimiterThe rate limiter to use.
Returns
- TBuilder
The builder instance with the rate limiter added.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
orlimiter
is null.- ValidationException
Thrown when the options constructed from the arguments are invalid.