pub trait BackgroundService {
// Required method
fn start<'life0, 'async_trait>(
&'life0 self,
shutdown: ShutdownWatch,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The background service interface
Required Methods§
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
shutdown: ShutdownWatch,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
shutdown: ShutdownWatch,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
This function is called when the pingora server tries to start all the
services. The background service can return at anytime or wait for the
shutdown
signal.