Table of Contents

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 TBuilder

The builder instance.

permitLimit int

Maximum number of permits that can be leased concurrently.

queueLimit int

Maximum 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 or queueLimit 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 TBuilder

The builder instance.

options ConcurrencyLimiterOptions

The concurrency limiter options.

Returns

TBuilder

The builder instance with the concurrency limiter added.

Type Parameters

TBuilder

The builder type.

Exceptions

ArgumentNullException

Thrown when builder or options 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 TBuilder

The builder instance.

options RateLimiterStrategyOptions

The rate limiter options.

Returns

TBuilder

The builder instance with the rate limiter added.

Type Parameters

TBuilder

The builder type.

Exceptions

ArgumentNullException

Thrown when builder or options 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 TBuilder

The builder instance.

limiter RateLimiter

The 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 or limiter is null.

ValidationException

Thrown when the options constructed from the arguments are invalid.