Skip to content

jamesbrayton/SimpleCircuitBreaker

 
 

Repository files navigation

A simple circuit breaker implementation for .NET.

Taking advantage of the library is as simple as wrapping your outgoing service call with circuitBreaker.Execute:

// Note: you'll need to keep this instance around
var breaker = new CircuitBreaker();
 
var client = new SmtpClient();
var message = new MailMessage();
breaker.Execute(() => client.SendEmail(message));

You can also take advantage of built-in retry logic:

breaker.ExecuteWithRetries(() => client.SendEmail(message), 10, TimeSpan.FromSeconds(20));

About

Another circuit breaker implementation for .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%