Skip to content

Instantly share code, notes, and snippets.

@patriknw
Created October 3, 2012 11:19
Show Gist options
  • Save patriknw/3826446 to your computer and use it in GitHub Desktop.
Save patriknw/3826446 to your computer and use it in GitHub Desktop.
Circuit Breaker Spotlight
import akka.pattern.CircuitBreaker
val breaker =
CircuitBreaker(system.scheduler,
maxFailures = 5,
callTimeout = 10.seconds,
resetTimeout = 1.minute)
def dangerous: Future[String] =
breaker.withCircuitBreaker(Future(dangerousCall))
def dangerousCall: String =
"This really isn't that dangerous"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment