Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

FaKod edited this page · 6 revisions
Clone this wiki locally

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
    }
  }
}

- – – -
Have a look at FaKods BLOG
Follow Me at Twitter

Something went wrong with that request. Please try again.