org.squbs.streams.circuitbreaker
the CircuitBreakerState implementation that holds the state of the circuit breaker
an optional clean up function to be applied on timed out elements when pushed
the function that gets called to determine if an element pased by the joined Flow is actually a failure or not
the function that gets called to provide an alternative response when the circuit is OPEN
the function that maps Context to a unique id
A container to hold circuit breaker settings.
Circuit Breaker functionality requires each element to be uniquely identified, so it requires a Context, of any type defined by the application, to be carried along with the flow's input and output as a Tuple2 (Scala) or Pair (Java). The requirement is that either the Context itself or a mapping from Context should be able to uniquely identify an element. Here is the ways how a unique id can be retrieved:
the type of the elements pulled from the upstream along with the Context and pushed down to joined flow
the type that's contained in a Try and pushed downstream along with the Context
the type of the context that is carried around along with the elements. The context may be of any type that can be used to uniquely identify each element