ReloadHook

Trait ReloadHook 

Source
pub trait ReloadHook: Send + Sync {
    // Required methods
    fn pre_reload<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        old_config: &'life1 Config,
        new_config: &'life2 Config,
    ) -> Pin<Box<dyn Future<Output = SentinelResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn post_reload<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        old_config: &'life1 Config,
        new_config: &'life2 Config,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn on_failure<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        config: &'life1 Config,
        error: &'life2 SentinelError,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn name(&self) -> &str;
}
Expand description

Reload hook trait for custom actions

Required Methods§

Source

fn pre_reload<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, old_config: &'life1 Config, new_config: &'life2 Config, ) -> Pin<Box<dyn Future<Output = SentinelResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called before reload starts

Source

fn post_reload<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, old_config: &'life1 Config, new_config: &'life2 Config, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called after successful reload

Source

fn on_failure<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, config: &'life1 Config, error: &'life2 SentinelError, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Called on reload failure

Source

fn name(&self) -> &str

Hook name for logging

Implementors§