pub trait Supervisor {
// Required methods
fn spawn(&mut self, svc: &Service) -> Result<Pid>;
fn terminate(&mut self, pid: Pid) -> Result<()>;
fn kill(&mut self, pid: Pid) -> Result<()>;
fn reap_one(&mut self) -> Result<Option<(Pid, i32)>>;
fn children(&self) -> Vec<(Pid, String)>;
}Expand description
Minimum interface a supervisor backend must expose.
Designed small enough for a mock to be a few dozen lines and big enough that the scheduler loop doesn’t need to reach past it for anything Linux-specific.
Required Methods§
Sourcefn terminate(&mut self, pid: Pid) -> Result<()>
fn terminate(&mut self, pid: Pid) -> Result<()>
Deliver SIGTERM to a PID. For graceful termination.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Supervisor for LinuxSupervisor
Available on Unix only.