Trait cluster_test::health::HealthCheck
source · 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§
sourcefn 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 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)
fn name(&self) -> &'static str
Provided Methods§
sourcefn on_event(&mut self, _event: &ValidatorEvent, _ctx: &mut HealthCheckContext)
fn on_event(&mut self, _event: &ValidatorEvent, _ctx: &mut HealthCheckContext)
Verify specific event
sourcefn invalidate(&mut self, _validator: &str)
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