Class CircuitBreakerResiliencePipelineBuilderExtensions
- Namespace
- Polly
- Assembly
- Polly.Core.dll
Circuit breaker extensions for ResiliencePipelineBuilder.
public static class CircuitBreakerResiliencePipelineBuilderExtensions
- Inheritance
-
CircuitBreakerResiliencePipelineBuilderExtensions
- Inherited Members
Methods
AddCircuitBreaker(ResiliencePipelineBuilder, CircuitBreakerStrategyOptions)
Adds circuit breaker to the builder.
public static ResiliencePipelineBuilder AddCircuitBreaker(this ResiliencePipelineBuilder builder, CircuitBreakerStrategyOptions options)
Parameters
builder
ResiliencePipelineBuilderThe builder instance.
options
CircuitBreakerStrategyOptionsThe options instance.
Returns
- ResiliencePipelineBuilder
A builder with the circuit breaker added.
Remarks
See CircuitBreakerStrategyOptions<TResult> for more details about the circuit breaker.
If you are discarding the circuit breaker by this call make sure to use CircuitBreakerManualControl and dispose the manual control instance when the circuit breaker is no longer used.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when
options
are invalid.
AddCircuitBreaker<TResult>(ResiliencePipelineBuilder<TResult>, CircuitBreakerStrategyOptions<TResult>)
Adds circuit breaker to the builder.
public static ResiliencePipelineBuilder<TResult> AddCircuitBreaker<TResult>(this ResiliencePipelineBuilder<TResult> builder, CircuitBreakerStrategyOptions<TResult> options)
Parameters
builder
ResiliencePipelineBuilder<TResult>The builder instance.
options
CircuitBreakerStrategyOptions<TResult>The options instance.
Returns
- ResiliencePipelineBuilder<TResult>
A builder with the circuit breaker added.
Type Parameters
TResult
The type of result the circuit breaker handles.
Remarks
See CircuitBreakerStrategyOptions<TResult> for more details about the circuit breaker.
If you are discarding the circuit breaker by this call make sure to use CircuitBreakerManualControl and dispose the manual control instance when the circuit breaker is no longer used.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when
options
are invalid.