-
-
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.
- Loading branch information
Showing
66 changed files
with
494 additions
and
351 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 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
25 changes: 24 additions & 1 deletion
25
src/Polly.Core/CircuitBreaker/CircuitBreakerPredicateArguments.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,11 +1,34 @@ | ||
namespace Polly.CircuitBreaker; | ||
|
||
#pragma warning disable CA1815 // Override equals and operator equals on value types | ||
|
||
/// <summary> | ||
/// Arguments used by <see cref="CircuitBreakerStrategyOptions{TResult}.ShouldHandle"/> predicate. | ||
/// </summary> | ||
/// <typeparam name="TResult">The type of result.</typeparam> | ||
/// <remarks> | ||
/// Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility. | ||
/// </remarks> | ||
public readonly struct CircuitBreakerPredicateArguments | ||
public readonly struct CircuitBreakerPredicateArguments<TResult> : IOutcomeArguments<TResult> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CircuitBreakerPredicateArguments{TResult}"/> struct. | ||
/// </summary> | ||
/// <param name="outcome">The context in which the resilience operation or event occurred.</param> | ||
/// <param name="context">The outcome of the resilience operation or event.</param> | ||
public CircuitBreakerPredicateArguments(ResilienceContext context, Outcome<TResult> outcome) | ||
{ | ||
Context = context; | ||
Outcome = outcome; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the outcome of the resilience operation or event. | ||
/// </summary> | ||
public Outcome<TResult> Outcome { get; } | ||
|
||
/// <summary> | ||
/// Gets the context in which the resilience operation or event occurred. | ||
/// </summary> | ||
public ResilienceContext Context { get; } | ||
} |
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
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
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,11 +1,34 @@ | ||
namespace Polly.Fallback; | ||
|
||
#pragma warning disable CA1815 // Override equals and operator equals on value types | ||
|
||
/// <summary> | ||
/// Represents arguments used in fallback handling scenarios. | ||
/// </summary> | ||
/// <typeparam name="TResult">The type of result.</typeparam> | ||
/// <remarks> | ||
/// Always use the constructor when creating this struct, otherwise we do not guarantee binary compatibility. | ||
/// </remarks> | ||
public readonly struct FallbackPredicateArguments | ||
public readonly struct FallbackPredicateArguments<TResult> : IOutcomeArguments<TResult> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="FallbackPredicateArguments{TResult}"/> struct. | ||
/// </summary> | ||
/// <param name="outcome">The context in which the resilience operation or event occurred.</param> | ||
/// <param name="context">The outcome of the resilience operation or event.</param> | ||
public FallbackPredicateArguments(ResilienceContext context, Outcome<TResult> outcome) | ||
{ | ||
Context = context; | ||
Outcome = outcome; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the outcome of the resilience operation or event. | ||
/// </summary> | ||
public Outcome<TResult> Outcome { get; } | ||
|
||
/// <summary> | ||
/// Gets the context in which the resilience operation or event occurred. | ||
/// </summary> | ||
public ResilienceContext Context { get; } | ||
} |
Oops, something went wrong.