-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Outcome and cleanup the options (#1235)
- Loading branch information
Showing
40 changed files
with
153 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 2 additions & 52 deletions
54
src/Polly.Core/CircuitBreaker/AdvancedCircuitBreakerStrategyOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,6 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Polly.CircuitBreaker; | ||
|
||
/// <summary> | ||
/// The options for advanced circuit breaker resilience strategy. | ||
/// </summary> | ||
/// <remarks> | ||
/// The circuit will break if, within any time-slice of duration <see cref="SamplingDuration"/>, | ||
/// the proportion of actions resulting in a handled exception exceeds <see cref="FailureThreshold"/>, | ||
/// provided also that the number of actions through the circuit in the time-slice is at least <see cref="MinimumThroughput"/>. | ||
/// <para> | ||
/// The circuit will stay broken for the <see cref="CircuitBreakerStrategyOptions.BreakDuration"/>. | ||
/// Any attempt to execute this while the circuit is broken, will immediately throw a <see cref="BrokenCircuitException"/> containing the exception | ||
/// that broke the circuit. | ||
/// </para> | ||
/// <para> | ||
/// If the first action after the break duration period results in a handled exception, the circuit will break | ||
/// again for another <see cref="CircuitBreakerStrategyOptions.BreakDuration"/>; if no exception is thrown, the circuit will reset. | ||
/// </para> | ||
/// </remarks> | ||
public class AdvancedCircuitBreakerStrategyOptions : CircuitBreakerStrategyOptions | ||
/// <inheritdoc/> | ||
public class AdvancedCircuitBreakerStrategyOptions : AdvancedCircuitBreakerStrategyOptions<object> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the failure threshold at which the circuit will break. | ||
/// </summary> | ||
/// <remarks> | ||
/// A number between zero and one (inclusive) e.g. 0.5 represents breaking if 50% or more of actions result in a handled failure. | ||
/// <para> | ||
/// A ratio number higher than 0, up to 1. | ||
/// Defaults to 0.1 (i.e. 10%). | ||
/// </para> | ||
/// </remarks> | ||
[Range(0, 1.0)] | ||
public double FailureThreshold { get; set; } = CircuitBreakerConstants.DefaultAdvancedFailureThreshold; | ||
|
||
/// <summary> | ||
/// Gets or sets the minimum throughput: this many actions or more must pass through the circuit in the time-slice, | ||
/// for statistics to be considered significant and the circuit-breaker to come into action. | ||
/// </summary> | ||
/// <remarks> | ||
/// Value must be 2 or greater. | ||
/// Defaults to 100. | ||
/// </remarks> | ||
[Range(CircuitBreakerConstants.MinimumValidThroughput, int.MaxValue)] | ||
public int MinimumThroughput { get; set; } = CircuitBreakerConstants.DefaultMinimumThroughput; | ||
|
||
/// <summary> | ||
/// Gets or sets the duration of the sampling over which failure ratios are assessed. | ||
/// </summary> | ||
/// <remarks> | ||
/// Value must be greater than 20 milliseconds. Defaults to 30 seconds. | ||
/// </remarks> | ||
[TimeSpan("00:00:00.020")] | ||
public TimeSpan SamplingDuration { get; set; } = CircuitBreakerConstants.DefaultSamplingDuration; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 0 additions & 116 deletions
116
src/Polly.Core/CircuitBreaker/CircuitBreakerStrategyOptions.TResult.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.