pub struct ProcessSupervisor { /* private fields */ }Implementations§
Source§impl ProcessSupervisor
impl ProcessSupervisor
pub fn new(stream_tx: Sender<StreamItem>) -> Self
pub fn reconcile( &mut self, desired: Vec<ProcessSpec>, ) -> ReconcileErrors<ProcessIdentity, SpawnError>
pub fn get(&self, identity: &ProcessIdentity) -> Option<&ProcessState>
pub fn iter(&self) -> impl Iterator<Item = (&ProcessIdentity, &ProcessState)>
Sourcepub fn shutdown_all(&mut self) -> ReconcileErrors<ProcessIdentity, SpawnError>
pub fn shutdown_all(&mut self) -> ReconcileErrors<ProcessIdentity, SpawnError>
Drains every tracked process by reconciling against an empty desired
set, driving each one through Lifecycle::exit (SIGTERM, then
SIGKILL after SHUTDOWN_GRACE_PERIOD).
Dropping a ProcessSupervisor does not do this on its own: Child’s
own Drop never kills its process, so call this explicitly before
the owning program exits or re-execs — otherwise every process it’s
still tracking is abandoned rather than torn down.
Auto Trait Implementations§
impl Freeze for ProcessSupervisor
impl RefUnwindSafe for ProcessSupervisor
impl Send for ProcessSupervisor
impl Sync for ProcessSupervisor
impl Unpin for ProcessSupervisor
impl UnsafeUnpin for ProcessSupervisor
impl UnwindSafe for ProcessSupervisor
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