CircuitBreakerSyntax
Fluent API for defining a Circuit Breaker Policy.
public static Policy CircuitBreaker(this PolicyBuilder policyBuilder, int exceptionsAllowedBeforeBreaking, TimeSpan durationOfBreak)
Builds a Policy that will function like a Circuit Breaker.
The circuit will break after exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised. 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 that broke the cicuit.
If the first action after the break duration period results in an exception, the circuit will break again for another durationOfBreak, otherwise it will reset.