pub struct ServiceManager { /* private fields */ }
Expand description
Manages services: start/stop/monitor
Implementations§
Source§impl ServiceManager
impl ServiceManager
pub fn register_service(&mut self, service: Box<dyn Service>)
pub async fn spawn_services(&mut self) -> Result<()>
pub async fn monitor(&self, check_interval: u64, log_interval: i32) -> Never
Sourcepub async fn monitor_with_recovery(
&self,
check_interval: u64,
log_interval: i32,
attempt_recovery_after: i32,
) -> Never
pub async fn monitor_with_recovery( &self, check_interval: u64, log_interval: i32, attempt_recovery_after: i32, ) -> Never
If a service is dead for over two minutes, try to restart it.
pub fn check(&self) -> ServiceReportSummary
Auto Trait Implementations§
impl Freeze for ServiceManager
impl !RefUnwindSafe for ServiceManager
impl Send for ServiceManager
impl Sync for ServiceManager
impl Unpin for ServiceManager
impl !UnwindSafe for ServiceManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more