C# Class Polly.AdvancedCircuitBreakerSyntax

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

Public Methods

Method Description
AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak ) : CircuitBreakerPolicy

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 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 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)

AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, Action onBreak, Action onReset ) : CircuitBreakerPolicy

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)

AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, 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, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)

AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset ) : CircuitBreakerPolicy

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)

AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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

AdvancedCircuitBreaker() public static method

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 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 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)
failureThreshold;Value must be greater than zero failureThreshold;Value must be less than or equal to one samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer minimumThroughput;Value must be greater than one durationOfBreak;Value must be greater than zero
public static AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
failureThreshold double The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure).
samplingDuration System.TimeSpan The duration of the timeslice over which failure ratios are assessed.
minimumThroughput int The minimum throughput: this many actions or more must pass through the circuit in the timeslice, for statistics to be considered significant and the circuit-breaker to come into action.
durationOfBreak System.TimeSpan The duration the circuit will stay open before resetting.
return Polly.CircuitBreaker.CircuitBreakerPolicy

AdvancedCircuitBreaker() public static method

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)
failureThreshold;Value must be greater than zero failureThreshold;Value must be less than or equal to one samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer minimumThroughput;Value must be greater than one durationOfBreak;Value must be greater than zero onBreak onReset
public static AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, Action onBreak, Action onReset ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
failureThreshold double The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure.
samplingDuration System.TimeSpan The duration of the timeslice over which failure ratios are assessed.
minimumThroughput int The minimum throughput: this many actions or more must pass through the circuit in the timeslice, for statistics to be considered significant and the circuit-breaker to come into action.
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

AdvancedCircuitBreaker() public static method

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 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 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)
failureThreshold;Value must be greater than zero failureThreshold;Value must be less than or equal to one samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer minimumThroughput;Value must be greater than one durationOfBreak;Value must be greater than zero onBreak onReset onHalfOpen
public static AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, Action onBreak, Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
failureThreshold double The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure.
samplingDuration System.TimeSpan The duration of the timeslice over which failure ratios are assessed.
minimumThroughput int The minimum throughput: this many actions or more must pass through the circuit in the timeslice, for statistics to be considered significant and the circuit-breaker to come into action.
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

AdvancedCircuitBreaker() public static method

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)
failureThreshold;Value must be greater than zero failureThreshold;Value must be less than or equal to one samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer minimumThroughput;Value must be greater than one durationOfBreak;Value must be greater than zero onBreak onReset
public static AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
failureThreshold double The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure.
samplingDuration System.TimeSpan The duration of the timeslice over which failure ratios are assessed.
minimumThroughput int The minimum throughput: this many actions or more must pass through the circuit in the timeslice, for statistics to be considered significant and the circuit-breaker to come into action.
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

AdvancedCircuitBreaker() public static method

The circuit will break if, within any timeslice of duration samplingDuration, the proportion of actions resulting in a handled exception 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 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)
failureThreshold;Value must be greater than zero failureThreshold;Value must be less than or equal to one samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer minimumThroughput;Value must be greater than one durationOfBreak;Value must be greater than zero onBreak onReset onHalfOpen
public static AdvancedCircuitBreaker ( this policyBuilder, double failureThreshold, System.TimeSpan samplingDuration, int minimumThroughput, System.TimeSpan durationOfBreak, TimeSpan>.Action onBreak, System.Action onReset, System.Action onHalfOpen ) : CircuitBreakerPolicy
policyBuilder this The policy builder.
failureThreshold double The failure threshold at which the circuit will break (a number between 0 and 1; eg 0.5 represents breaking if 50% or more of actions result in a handled failure.
samplingDuration System.TimeSpan The duration of the timeslice over which failure ratios are assessed.
minimumThroughput int The minimum throughput: this many actions or more must pass through the circuit in the timeslice, for statistics to be considered significant and the circuit-breaker to come into action.
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