Job

Trait Job 

Source
pub trait Job:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn execute<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = JobResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn max_retries(&self) -> u32 { ... }
    fn backoff_strategy(&self) -> BackoffStrategy { ... }
}
Expand description

Generic Job Trait

Required Methods§

Source

fn name(&self) -> &str

Job name/type

Source

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

Execute the job

Provided Methods§

Source

fn max_retries(&self) -> u32

Max retries allowed

Source

fn backoff_strategy(&self) -> BackoffStrategy

Backoff strategy

Implementors§