forked from App-vNext/Polly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds interfaces to Polly. Delivers App-vNext#257
- Loading branch information
1 parent
ec283ce
commit 41a7677
Showing
42 changed files
with
1,328 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
|
||
namespace Polly.Bulkhead | ||
{ | ||
/// <summary> | ||
/// Defines properties and methods common to all bulkhead policies. | ||
/// </summary> | ||
|
||
public interface IBulkheadPolicy : IsPolicy, IDisposable | ||
{ | ||
/// <summary> | ||
/// Gets the number of slots currently available for executing actions through the bulkhead. | ||
/// </summary> | ||
int BulkheadAvailableCount { get; } | ||
|
||
/// <summary> | ||
/// Gets the number of slots currently available for queuing actions for execution through the bulkhead. | ||
/// </summary> | ||
int QueueAvailableCount { get; } | ||
} | ||
|
||
/// <summary> | ||
/// Defines properties and methods common to all bulkhead policies generic-typed for executions returning results of type <typeparamref name="TResult"/>. | ||
/// </summary> | ||
public interface IBulkheadPolicy<TResult> : IBulkheadPolicy | ||
{ | ||
|
||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
|
||
namespace Polly.CircuitBreaker | ||
{ | ||
/// <summary> | ||
/// Defines properties and methods common to all circuit-breaker policies. | ||
/// </summary> | ||
public interface ICircuitBreakerPolicy : IsPolicy | ||
{ | ||
/// <summary> | ||
/// Gets the state of the underlying circuit. | ||
/// </summary> | ||
CircuitState CircuitState { get; } | ||
|
||
/// <summary> | ||
/// Gets the last exception handled by the circuit-breaker. | ||
/// <remarks>This will be null if no exceptions have been handled by the circuit-breaker since the circuit last closed.</remarks> | ||
/// </summary> | ||
Exception LastException { get; } | ||
|
||
/// <summary> | ||
/// Isolates (opens) the circuit manually, and holds it in this state until a call to <see cref="CircuitBreakerPolicy.Reset"/> is made. | ||
/// </summary> | ||
void Isolate(); | ||
|
||
/// <summary> | ||
/// Closes the circuit, and resets any statistics controlling automated circuit-breaking. | ||
/// </summary> | ||
void Reset(); | ||
} | ||
|
||
/// <summary> | ||
/// Defines properties and methods common to all circuit-breaker policies generic-typed for executions returning results of type <typeparamref name="TResult"/>. | ||
/// </summary> | ||
public interface ICircuitBreakerPolicy<TResult> : ICircuitBreakerPolicy | ||
{ | ||
/// <summary> | ||
/// Gets the last result returned from a user delegate which the circuit-breaker handled. | ||
/// <remarks>This will be default(<typeparamref name="TResult"/>) if no results have been handled by the circuit-breaker since the circuit last closed, or if the last event handled by the circuit was an exception.</remarks> | ||
/// </summary> | ||
TResult LastHandledResult { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Polly.Fallback | ||
{ | ||
/// <summary> | ||
/// Defines properties and methods common to all Fallback policies. | ||
/// </summary> | ||
|
||
public interface IFallbackPolicy : IsPolicy | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Defines properties and methods common to all Fallback policies generic-typed for executions returning results of type <typeparamref name="TResult"/>. | ||
/// </summary> | ||
public interface IFallbackPolicy<TResult> : IFallbackPolicy | ||
{ | ||
|
||
} | ||
} |
Oops, something went wrong.