C# Class Polly.CircuitBreakerSyntax

Fluent API for defining a Circuit Breaker Policy.
显示文件 Open project: App-vNext/Polly

Public Methods

Method Description
CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak ) : CircuitBreakerPolicy

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)

CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, Action onBreak, Action onReset ) : CircuitBreakerPolicy

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)

CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, Action onBreak, Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)

CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset ) : CircuitBreakerPolicy

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)

CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)

Method Details

CircuitBreaker() public static method

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)
exceptionsAllowedBeforeBreaking;Value must be greater than zero. onBreak onReset
public static CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
exceptionsAllowedBeforeBreaking int The number of exceptions that are allowed before opening the circuit.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
return Polly.CircuitBreaker.CircuitBreakerPolicy

CircuitBreaker() public static method

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)
exceptionsAllowedBeforeBreaking;Value must be greater than zero. onBreak onReset
public static CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, Action onBreak, Action onReset ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
exceptionsAllowedBeforeBreaking int The number of exceptions that are allowed before opening the circuit.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
onBreak Action The action to call when the circuit transitions to an state.
onReset Action The action to call when the circuit resets to a state.
return Polly.CircuitBreaker.CircuitBreakerPolicy

CircuitBreaker() public static method

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)
exceptionsAllowedBeforeBreaking;Value must be greater than zero. onBreak onReset onHalfOpen
public static CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, Action onBreak, Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
exceptionsAllowedBeforeBreaking int The number of exceptions that are allowed before opening the circuit.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
onBreak Action The action to call when the circuit transitions to an state.
onReset Action The action to call when the circuit resets to a state.
onHalfOpen System.Action The action to call when the circuit transitions to state, ready to try action executions again.
return Polly.CircuitBreaker.CircuitBreakerPolicy

CircuitBreaker() public static method

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)
exceptionsAllowedBeforeBreaking;Value must be greater than zero. onBreak onReset
public static CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
exceptionsAllowedBeforeBreaking int The number of exceptions that are allowed before opening the circuit.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
onBreak TimeSpan>.Action The action to call when the circuit transitions to an state.
onReset System.Action The action to call when the circuit resets to a state.
return Polly.CircuitBreaker.CircuitBreakerPolicy

CircuitBreaker() public static method

Builds a Policy that will function like a Circuit Breaker.

The circuit will break if exceptionsAllowedBeforeBreaking exceptions that are handled by this policy are raised consecutively.

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 circuit.

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

(see "Release It!" by Michael T. Nygard fi)
exceptionsAllowedBeforeBreaking;Value must be greater than zero. onBreak onReset
public static CircuitBreaker ( this policyBuilder, int exceptionsAllowedBeforeBreaking, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
exceptionsAllowedBeforeBreaking int The number of exceptions that are allowed before opening the circuit.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
onBreak TimeSpan>.Action The action to call when the circuit transitions to an state.
onReset System.Action The action to call when the circuit resets to a state.
onHalfOpen System.Action The action to call when the circuit transitions to state, ready to try action executions again.
return Polly.CircuitBreaker.CircuitBreakerPolicy