Trait ora_api::Handler

source ·
pub trait Handler<T>where
    Self: Sized + Send + Sync + 'static,
    T: Task,{
    // Required method
    fn run<'life0, 'async_trait>(
        &'life0 self,
        ctx: TaskContext,
        task: T
    ) -> Pin<Box<dyn Future<Output = Result<T::Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A strongly-typed worker that can

Required Methods§

source

fn run<'life0, 'async_trait>( &'life0 self, ctx: TaskContext, task: T ) -> Pin<Box<dyn Future<Output = Result<T::Output>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Run the given task.

Implementors§