Click or drag to resize
Akka.NETCircuitBreaker Class
Provides circuit breaker functionality to provide stability when working with "dangerous" operations, e.g. calls to remote systems
  • In *Closed* state, - calls pass through until the maxFailures count is reached. This causes the circuit breaker to open. Both exceptions and calls exceeding callTimeout are considered failures.
  • In *Open* state, - calls fail-fast with an exception. After resetTimeout, circuit breaker transitions to half-open state.
  • In *Half-Open* state, - the first call will be allowed through, if it succeeds the circuit breaker will reset to closed state. If it fails, the circuit breaker will re-open to open state. All calls beyond the first that execute while the first is running will fail-fast with an exception.
Inheritance Hierarchy
SystemObject
  Akka.PatternCircuitBreaker

Namespace:  Akka.Pattern
Assembly:  Akka (in Akka.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax
public class CircuitBreaker

The CircuitBreaker type exposes the following members.

Constructors
  NameDescription
Public methodCircuitBreaker
Create a new CircuitBreaker
Top
Properties
  NameDescription
Public propertyCallTimeout
TBD
Public propertyCurrentFailureCount
Retrieves current failure count.
Public propertyMaxFailures
TBD
Public propertyResetTimeout
TBD
Top
Methods
  NameDescription
Public methodStatic memberCreate
Create a new CircuitBreaker
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnClose
Adds a callback to execute when circuit breaker state closes
Public methodOnHalfOpen
Adds a callback to execute when circuit breaker transitions to half-open
Public methodOnOpen
Adds a callback to execute when circuit breaker opens
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWithCircuitBreaker(FuncTask)
Wraps invocation of asynchronous calls that need to be protected
Public methodWithCircuitBreakerT(FuncTaskT)
Wraps invocation of asynchronous calls that need to be protected
Public methodWithSyncCircuitBreaker(Action)
The failure will be recorded farther down.
Public methodWithSyncCircuitBreakerT(FuncT)
Wraps invocations of asynchronous calls that need to be protected If this does not complete within the time allotted, it should return default(T)
Await.result(
    withCircuitBreaker(try Future.successful(body) catch { case NonFatal(t) ⇒ Future.failed(t) }),
    callTimeout)
Top
Extension Methods
See Also