Trait jatsl::Job[][src]

pub trait Job {
    const NAME: &'static str;
    const SUPPORTS_GRACEFUL_TERMINATION: bool;

    fn execute<'life0, 'async_trait>(
        &'life0 self,
        manager: JobManager
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync + 'static>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn name(&self) -> String { ... }
fn supports_graceful_termination(&self) -> bool { ... } }
Expand description

Persistent execution unit

Jobs can be dependent on resource (which can be basically anything you define). If such a resource dependency becomes unavailable the job is terminated and restarted.

In addition, jobs can support graceful shutdown and a ready state provided by the TaskManager passed to the execute function.

Associated Constants

Name of the job displayed in log messages

Whether or not the job honors the termination signal. When this is set to false the job will be terminated externally.

Required methods

Provided methods

Implementors