pub enum ProcState {
Pending,
Starting,
Running,
Draining,
Exited,
Failed,
}Expand description
Lifecycle vocabulary of a supervised process.
Deliberately identical to [kamaji_proto::WorkloadState] on the wire. Kept
as a separate type rather than a re-export so the default build of this
crate — the one a workload links — carries no supervisor protocol at all.
Variants§
Pending
Accepted, nothing started yet.
Starting
Started, not yet serving — booting, migrating, warming a cache.
Running
Serving. This is the only state that counts as ready.
Draining
Shutting down gracefully.
Exited
Exited cleanly.
Failed
Exited with a failure, or reported itself unrecoverable.
Implementations§
Source§impl ProcState
impl ProcState
Sourcepub fn is_ready(self) -> bool
pub fn is_ready(self) -> bool
Whether a process in this state is ready to be used.
Starting is deliberately not ready: the entire point of the channel
is to distinguish “the port is open” from “I am serving”.
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Whether this state is terminal — no amount of further polling changes it, so a readiness wait should fail fast rather than burn its timeout.