pub struct ServiceManager { /* private fields */ }Expand description
Manages the lifecycle of daemon child services.
Implementations§
Source§impl ServiceManager
impl ServiceManager
Sourcepub fn new(
configs: &BTreeMap<String, ServiceConfig>,
config_dir: &Path,
daemon_socket: PathBuf,
) -> Self
pub fn new( configs: &BTreeMap<String, ServiceConfig>, config_dir: &Path, daemon_socket: PathBuf, ) -> Self
Create a new manager from config. Does not spawn anything yet.
daemon_socket is the daemon’s UDS path — forwarded to gateway services
so they can connect back.
Sourcepub async fn spawn_all(&mut self) -> Result<()>
pub async fn spawn_all(&mut self) -> Result<()>
Spawn all enabled services.
Extension services get --socket <path> so they bind a UDS listener.
Gateway services get --daemon <path> and --config <json> so they
can connect back to the daemon.
Sourcepub async fn handshake_all(&self) -> ServiceRegistry
pub async fn handshake_all(&self) -> ServiceRegistry
Connect to all extension services and perform the handshake.
Returns a ServiceRegistry with tool and query mappings.
Sourcepub async fn shutdown_all(&mut self)
pub async fn shutdown_all(&mut self)
Graceful shutdown of all services. Signals each child to stop, waits up to 5s, then force-kills stragglers.
Auto Trait Implementations§
impl Freeze for ServiceManager
impl !RefUnwindSafe for ServiceManager
impl Send for ServiceManager
impl Sync for ServiceManager
impl Unpin for ServiceManager
impl UnsafeUnpin 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