pub struct LifecycleManager { /* private fields */ }Expand description
Lifecycle Manager
Manages service lifecycle events including:
- Connection initialization
- Heartbeat monitoring
- Auto-reconnection with backoff
- Graceful shutdown
Implementations§
Source§impl LifecycleManager
impl LifecycleManager
Sourcepub fn new(registry: Arc<RegistryService>) -> Self
pub fn new(registry: Arc<RegistryService>) -> Self
Create a new lifecycle manager
Sourcepub fn with_config(
registry: Arc<RegistryService>,
config: LifecycleConfig,
) -> Self
pub fn with_config( registry: Arc<RegistryService>, config: LifecycleConfig, ) -> Self
Create a new lifecycle manager with configuration
Sourcepub fn subscribe(&self) -> Receiver<LifecycleEvent>
pub fn subscribe(&self) -> Receiver<LifecycleEvent>
Subscribe to lifecycle events
Sourcepub async fn start_service(
&self,
service: ExtensionService,
) -> Result<ServiceId, LifecycleError>
pub async fn start_service( &self, service: ExtensionService, ) -> Result<ServiceId, LifecycleError>
Start managing a service
Sourcepub async fn stop_service(&self, id: &ServiceId) -> Result<(), LifecycleError>
pub async fn stop_service(&self, id: &ServiceId) -> Result<(), LifecycleError>
Stop managing a service
Sourcepub async fn handle_heartbeat(
&self,
id: &ServiceId,
) -> Result<(), LifecycleError>
pub async fn handle_heartbeat( &self, id: &ServiceId, ) -> Result<(), LifecycleError>
Handle heartbeat from a service
Sourcepub async fn handle_error(
&self,
id: &ServiceId,
error: String,
) -> Result<(), LifecycleError>
pub async fn handle_error( &self, id: &ServiceId, error: String, ) -> Result<(), LifecycleError>
Handle service error
Sourcepub async fn get_status(&self, id: &ServiceId) -> Option<ServiceStatus>
pub async fn get_status(&self, id: &ServiceId) -> Option<ServiceStatus>
Get service status
Sourcepub async fn is_healthy(&self, id: &ServiceId) -> bool
pub async fn is_healthy(&self, id: &ServiceId) -> bool
Check if service is healthy
Sourcepub async fn health_check(&self) -> Vec<ServiceId>
pub async fn health_check(&self) -> Vec<ServiceId>
Trigger health check for all services
Auto Trait Implementations§
impl !RefUnwindSafe for LifecycleManager
impl !UnwindSafe for LifecycleManager
impl Freeze for LifecycleManager
impl Send for LifecycleManager
impl Sync for LifecycleManager
impl Unpin for LifecycleManager
impl UnsafeUnpin for LifecycleManager
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