Skip to main content

Supervisor

Trait Supervisor 

Source
pub trait Supervisor {
    // Required methods
    fn up(&self, spec: &AgentSpec) -> Result<()>;
    fn down(&self, spec: &AgentSpec) -> Result<()>;
    fn state(&self, spec: &AgentSpec) -> Result<AgentState>;

    // Provided method
    fn drain(
        &self,
        spec: &AgentSpec,
        _timeout: Duration,
    ) -> Result<DrainOutcome> { ... }
}

Required Methods§

Source

fn up(&self, spec: &AgentSpec) -> Result<()>

Source

fn down(&self, spec: &AgentSpec) -> Result<()>

Source

fn state(&self, spec: &AgentSpec) -> Result<AgentState>

Provided Methods§

Source

fn drain(&self, spec: &AgentSpec, _timeout: Duration) -> Result<DrainOutcome>

Stop an agent gracefully. The default implementation falls back to down() for back-ends that don’t implement signal delivery (or where graceful shutdown isn’t meaningful — e.g. a MockSupervisor in tests).

Implementors§