pub struct SupervisedModule { /* private fields */ }Expand description
Handle to one supervised child process.
Implementations§
Source§impl SupervisedModule
impl SupervisedModule
pub fn module_id(&self) -> &str
pub fn state(&self) -> Result<ModuleState, SuperviseError>
Sourcepub fn stderr_tail(
&self,
max_lines: Option<usize>,
max_bytes: Option<usize>,
) -> StderrTailSnapshot
pub fn stderr_tail( &self, max_lines: Option<usize>, max_bytes: Option<usize>, ) -> StderrTailSnapshot
The module’s retained stderr, newest lines last.
Deliberately NOT on Self::status: a bounded tail is kilobytes per
module, supervisor.list renders every module, and putting it in the
shared snapshot would make each status read carry a payload almost nobody
asked for. Callers that want the text ask for it.
Sourcepub fn terminal_history(&self) -> TerminalHistorySnapshot
pub fn terminal_history(&self) -> TerminalHistorySnapshot
The module’s bounded terminal history, oldest retained exit first.
The daemon-start stamp distinguishes a quiet supervisor from a replacement daemon whose in-memory history was necessarily reset.
Sourcepub fn durable_terminal_history(&self) -> TerminalHistory
pub fn durable_terminal_history(&self) -> TerminalHistory
Retained observations from the current ring and all journal generations.
Blocking: this reads the journal files. Async callers use
Self::read_durable_terminal_history.
pub fn status(&self) -> Result<ModuleStatus, SuperviseError>
Sourcepub async fn drain(&self) -> Result<(), SuperviseError>
pub async fn drain(&self) -> Result<(), SuperviseError>
Drain the module and stop monitoring it.
pub async fn stop(&self) -> Result<(), SuperviseError>
pub async fn restart( &self, drain_timeout_ms: Option<u64>, ) -> Result<(), SuperviseError>
Sourcepub async fn swap(
&self,
ready_timeout: Option<Duration>,
) -> Result<SwapOutcome, SuperviseError>
pub async fn swap( &self, ready_timeout: Option<Duration>, ) -> Result<SwapOutcome, SuperviseError>
Blue/green restart: see SupervisorCommand::Swap and the
supervisor_swap module. Returns once the swap has cut over (the old
process then drains in the background of the supervise loop), has been
superseded by an approved configuration restart, or has failed. Both
supersession and failure leave the old process serving until replacement.