<PackageReference Include="Polly" Version="5.1.0" />

AdvancedCircuitBreakerTResultSyntax

Fluent API for defining a Circuit Breaker Policy.
public static CircuitBreakerPolicy<TResult> AdvancedCircuitBreaker<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak)

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception or result exceeds failureThreshold, provided also that the number of actions through the circuit in the timeslice is at least minimumThroughput.

The circuit will stay broken for the durationOfBreak. Any attempt to execute this policy while the circuit is broken, will immediately throw a BrokenCircuitException containing the exception or result that broke the circuit.

If the first action after the break duration period results in a handled exception or result, the circuit will break again for another durationOfBreak; if no exception or handled result is encountered, the circuit will reset.

public static CircuitBreakerPolicy<TResult> AdvancedCircuitBreaker<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, TimeSpan> onBreak, Action onReset)

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception or result exceeds failureThreshold, provided also that the number of actions through the circuit in the timeslice is at least minimumThroughput.

The circuit will stay broken for the durationOfBreak. Any attempt to execute this policy while the circuit is broken, will immediately throw a BrokenCircuitException containing the exception or result that broke the circuit.

If the first action after the break duration period results in a handled exception or result, the circuit will break again for another durationOfBreak; if no exception or handled result is encountered, the circuit will reset.

public static CircuitBreakerPolicy<TResult> AdvancedCircuitBreaker<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, TimeSpan, Context> onBreak, Action<Context> onReset)

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception or result exceeds failureThreshold, provided also that the number of actions through the circuit in the timeslice is at least minimumThroughput.

The circuit will stay broken for the durationOfBreak. Any attempt to execute this policy while the circuit is broken, will immediately throw a BrokenCircuitException containing the exception or result that broke the circuit.

If the first action after the break duration period results in a handled exception or result, the circuit will break again for another durationOfBreak; if no exception or handled result is encountered, the circuit will reset.

public static CircuitBreakerPolicy<TResult> AdvancedCircuitBreaker<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, TimeSpan> onBreak, Action onReset, Action onHalfOpen)

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception or result exceeds failureThreshold, provided also that the number of actions through the circuit in the timeslice is at least minimumThroughput.

The circuit will stay broken for the durationOfBreak. Any attempt to execute this policy while the circuit is broken, will immediately throw a BrokenCircuitException containing the exception or result that broke the circuit.

If the first action after the break duration period results in a handled exception or result, the circuit will break again for another durationOfBreak; if no exception or handled result is encountered, the circuit will reset.

public static CircuitBreakerPolicy<TResult> AdvancedCircuitBreaker<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, TimeSpan, Context> onBreak, Action<Context> onReset, Action onHalfOpen)

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception or result exceeds failureThreshold, provided also that the number of actions through the circuit in the timeslice is at least minimumThroughput.

The circuit will stay broken for the durationOfBreak. Any attempt to execute this policy while the circuit is broken, will immediately throw a BrokenCircuitException containing the exception or result that broke the circuit.

If the first action after the break duration period results in a handled exception or result, the circuit will break again for another durationOfBreak; if no exception or handled result is encountered, the circuit will reset.