pub trait HealthCheck: Send {
    // Required methods
    fn verify<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _ctx: &'life1 mut HealthCheckContext
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn name(&self) -> &'static str;

    // Provided methods
    fn on_event(&mut self, _event: &ValidatorEvent, _ctx: &mut HealthCheckContext) { ... }
    fn invalidate(&mut self, _validator: &str) { ... }
    fn clear(&mut self) { ... }
}

Required Methods§

source

fn verify<'life0, 'life1, 'async_trait>( &'life0 mut self, _ctx: &'life1 mut HealthCheckContext ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Periodic verification (happens even if when no events produced)

source

fn name(&self) -> &'static str

Provided Methods§

source

fn on_event(&mut self, _event: &ValidatorEvent, _ctx: &mut HealthCheckContext)

Verify specific event

source

fn invalidate(&mut self, _validator: &str)

Optionally marks validator as failed, requiring waiting for at least one event from it to mark it as healthy again

source

fn clear(&mut self)

Clean is invoked when cluster is wiped This means that checks like commit history check should wipe internal state

Implementors§