pub trait Runnable:
Send
+ Sync
+ 'static {
// Required method
fn run<'async_trait>(
self: Arc<Self>,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Trait for modules that can run a long-running task.
Note: take self by Arc to make the spawned future 'static and Send.