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.
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<(), SuperviseError>
pub async fn swap( &self, ready_timeout: Option<Duration>, ) -> Result<(), 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) or has
failed, leaving the old process serving.