Trait jatsl::Job[][src]

pub trait Job {
    type Context;

    const NAME: &'static str;
    const SUPPORTS_GRACEFUL_TERMINATION: bool;

#[must_use]    fn execute<'life0, 'async_trait>(
        &'life0 self,
        manager: TaskManager<Self::Context>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn name(&self) -> &'static str { ... }
fn supports_graceful_termination(&self) -> bool { ... } }

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 Types

Loading content...

Associated Constants

const NAME: &'static str[src]

Name of the job displayed in log messages

const SUPPORTS_GRACEFUL_TERMINATION: bool[src]

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

Loading content...

Required methods

#[must_use]fn execute<'life0, 'async_trait>(
    &'life0 self,
    manager: TaskManager<Self::Context>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Loading content...

Provided methods

fn name(&self) -> &'static str[src]

fn supports_graceful_termination(&self) -> bool[src]

Loading content...

Implementors

impl<C: Send + Sync + 'static> Job for StatusServer<C>[src]

type Context = C

Loading content...