Skip to content

FaKod/Circuit-Breaker-for-Scala

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

This is a Scala Implementation of the Circuit Breaker state machine mentioned in the book Release It

I used the GoF State Machine pattern (like Ken DeLong), implemented it in Scala and added some factory stuff.

Use it like this

. . .
addCircuitBreaker("test", CircuitBreakerConfiguration(100,10))
. . .

class Test extends UsingCircuitBreaker {
  def myMethodWorkingFine = {
    withCircuitBreaker("test") {
      . . . 
    }
  }

  def myMethodDoingWrong = {
    withCircuitBreaker("test") {
      throw new java.lang.IllegalArgumentException
    }
  }
}

I will add maven pom and addional test specs (see src/TestCircuitBreaker.scala) later.

About

Guard external service access with a Circuit Breaker based on the book "Release It" (Michael Nygard)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages