Trait Service
Source pub trait Service: Sync + Send {
// Required methods
fn spawn<'async_trait>(
self: Arc<Self>,
runtime: Runtime,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
fn terminate(self: Arc<Self>);
fn join<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
// Provided method
fn name(&self) -> &'static str { ... }
}
Signal the service termination (post a shutdown request)
Block until the service is terminated