pub struct FaultManager { /* private fields */ }Expand description
Tracks failures across all nodes and manages their circuit breakers.
Implementations§
Source§impl FaultManager
impl FaultManager
Sourcepub fn report_failure(&mut self, node_id: u64, ftype: FailureType, now: u64)
pub fn report_failure(&mut self, node_id: u64, ftype: FailureType, now: u64)
Report a new failure for a node.
Sourcepub fn node_recovered(&mut self, node_id: u64, now: u64)
pub fn node_recovered(&mut self, node_id: u64, now: u64)
Mark a node as recovered at now.
Sourcepub fn active_failures(&self) -> Vec<&NodeFailure>
pub fn active_failures(&self) -> Vec<&NodeFailure>
Return all failures that have not yet been recovered.
Sourcepub fn is_node_healthy(&mut self, node_id: u64, now: u64) -> bool
pub fn is_node_healthy(&mut self, node_id: u64, now: u64) -> bool
Returns true if the node’s circuit breaker permits a call at now.
Nodes without a registered breaker are considered healthy.
Trait Implementations§
Source§impl Debug for FaultManager
impl Debug for FaultManager
Source§impl Default for FaultManager
impl Default for FaultManager
Source§fn default() -> FaultManager
fn default() -> FaultManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FaultManager
impl RefUnwindSafe for FaultManager
impl Send for FaultManager
impl Sync for FaultManager
impl Unpin for FaultManager
impl UnsafeUnpin for FaultManager
impl UnwindSafe for FaultManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request