.Net CircuitBreaker
C#
Latest commit 55d1478 May 13, 2016 @MrDesjardins Configuration for CI
Permalink
Failed to load latest commit information.
DotNetCircuitBreakerUnitTest Configuration for CI May 14, 2016
Properties first commit May 14, 2016
.gitignore first commit May 14, 2016
.travis.yml Configuration for CI May 14, 2016
CircuitBreaker.cs
CircuitBreakerState.cs
ClosedState.cs
DotNetCircuitBreaker.csproj Configuration for CI May 14, 2016
DotNetCircuitBreaker.nuspec first commit May 14, 2016
DotNetCircuitBreaker.sln
HalfOpenState.cs first commit May 14, 2016
ICircuitBreaker.cs
OpenState.cs first commit May 14, 2016
README.md

README.md

.Net Circuit Breaker

Build Status

dotnetcircuitbreaker MyGet Build Status

NuGet Badge

Build history

.Net Circuit Breaker is a simple implementation of the circuit breaker pattern.

This allow to have Area and Controller based route in Asp.Net MVC in a Fluent way for multiple language (as this moment English and French hardcoded).

Examples

Here is how to use the circuit breaker:

//After 10 tries we wait 5 minutes
var circuitBreaker = new  DotNetCircuitBreaker.CircuitBreaker(10, TimeSpan.FromMinutes(5));
//Execute the protectedCode
circuitBreaker.AttemptCall(protectedCode);

It's possible to know when it's been executed or not and log or do what ever is required.

circuitBreaker.AttemptCall(protectedCode);
if(circuitBreaker.IsOpen)
{
    //Open = Something went wrong.
}

You can also listen to an event when the state of the circuit breaker change:

circuitBreaker.OnStateChange += (o, state) => { /*Do what you want*/ };

Documentations

You can find more detail here:

Nuget Package

You can find a Nuget package of this project at Nuget.org