TaskService

Trait TaskService 

Source
pub trait TaskService: Service {
    // Required method
    fn run_task(&mut self) -> LocalBoxFuture<'_, Result<(), String>>;

    // Provided method
    fn init(&mut self) -> LocalBoxFuture<'_, Result<(), String>> { ... }
}
Expand description

Implement this trait if your service needs to run a task in the background.

The implementation here does not need to be Send as we only run the task on a single thread executor.

Required Methods§

Source

fn run_task(&mut self) -> LocalBoxFuture<'_, Result<(), String>>

Provided Methods§

Source

fn init(&mut self) -> LocalBoxFuture<'_, Result<(), String>>

Implementors§