pub trait CircuitBreaker {
    fn is_call_permitted(&self) -> bool;
    fn call_with<F, P>(
        &self,
        predicate: P,
        f: F
    ) -> ResponseFuture<F, Self::FailurePolicy, Self::Instrument, P>
    where
        F: Future,
        P: FailurePredicate<F::Error>
; fn call<F>(
        &self,
        f: F
    ) -> ResponseFuture<F, Self::FailurePolicy, Self::Instrument, Any>
    where
        F: Future
, { ... } }
Expand description

A futures aware circuit breaker’s public interface.

Required Methods

Requests permission to call.

It returns true if a call is allowed, or false if prohibited.

Executes a given future within circuit breaker.

Depending on future result value, the call will be recorded as success or failure. It checks error by the provided predicate. If the predicate returns true for the error, the call is recorded as failure otherwise considered this error as a success.

Provided Methods

Executes a given future within circuit breaker.

Depending on future result value, the call will be recorded as success or failure.

Implementors