[][src]Trait aprun::ServiceTask

pub trait ServiceTask {
    fn service_name(&self) -> String;
#[must_use] fn run_service_check<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn should_run(&self) -> bool; fn should_run_last_interval(
        &self,
        last_run: Option<SystemTime>,
        interval: Duration
    ) -> bool { ... } }

Required methods

fn service_name(&self) -> String

To identify service task

#[must_use]fn run_service_check<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

fn should_run(&self) -> bool

ServiceTasks are triggered often ( 1s interval ) This method should tell whether run also this ServiceTask in current run.

Loading content...

Provided methods

fn should_run_last_interval(
    &self,
    last_run: Option<SystemTime>,
    interval: Duration
) -> bool

Should run when elapsed time from last run is higher then interval

Loading content...

Implementors

Loading content...