pub struct ProcessManager { /* private fields */ }Implementations§
Source§impl ProcessManager
impl ProcessManager
Sourcepub fn with_shutdown_handle(shutdown_handle: ShutdownHandle) -> Self
pub fn with_shutdown_handle(shutdown_handle: ShutdownHandle) -> Self
Create a new process manager with shutdown handle
Sourcepub fn add_dependency(&mut self, node: String, dependency: String)
pub fn add_dependency(&mut self, node: String, dependency: String)
Add a dependency relationship
Specifies that node depends on dependency and should be stopped before it.
§Arguments
node- The node that depends on anotherdependency- The node that is depended upon
Sourcepub fn status_all(&mut self) -> HashMap<String, ProcessStatus>
pub fn status_all(&mut self) -> HashMap<String, ProcessStatus>
Get status of all processes
Sourcepub fn processes(&mut self) -> Vec<ProcessInfo>
pub fn processes(&mut self) -> Vec<ProcessInfo>
Get information about all tracked processes
Sourcepub fn shutdown_order(&self) -> Vec<String>
pub fn shutdown_order(&self) -> Vec<String>
Calculate shutdown order based on dependency graph
Returns nodes in the order they should be stopped (dependents before dependencies).
Sourcepub fn force_kill(&mut self, name: &str) -> Result<()>
pub fn force_kill(&mut self, name: &str) -> Result<()>
Force kill a process immediately
Sourcepub fn shutdown_all(&mut self)
pub fn shutdown_all(&mut self)
Stop all processes in dependency order with graceful shutdown
Sourcepub fn is_running(&mut self, name: &str) -> bool
pub fn is_running(&mut self, name: &str) -> bool
Check if a specific process is running
Trait Implementations§
Source§impl Default for ProcessManager
impl Default for ProcessManager
Source§impl Drop for ProcessManager
impl Drop for ProcessManager
Auto Trait Implementations§
impl !RefUnwindSafe for ProcessManager
impl !UnwindSafe for ProcessManager
impl Freeze for ProcessManager
impl Send for ProcessManager
impl Sync for ProcessManager
impl Unpin for ProcessManager
impl UnsafeUnpin for ProcessManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more