pub struct ControlService { /* private fields */ }Expand description
One process’s lifecycle control, independent of application capacity and I/O.
Implementations§
Source§impl ControlService
impl ControlService
Sourcepub fn selection_committed(&self, generation: u64, build: String) -> Result<()>
pub fn selection_committed(&self, generation: u64, build: String) -> Result<()>
Announce an already committed selection. Call only after publication succeeds; this method does not write the application’s discovery record. A generation cannot move backwards or change its build identity. Until the first call, WATCH reports no observed selection. A staged process may observe an incumbent with a lower generation than its own.
Sourcepub fn mark_retiring(&self)
pub fn mark_retiring(&self)
Close admission and announce retirement. Existing requests keep their leases; the caller still owns draining and process shutdown.
Source§impl ControlService
impl ControlService
Sourcepub fn new(
lifecycle: Arc<Lifecycle>,
generation: u64,
build: String,
revision: u64,
) -> Self
pub fn new( lifecycle: Arc<Lifecycle>, generation: u64, build: String, revision: u64, ) -> Self
Start in the initializing state. The consumer marks readiness explicitly.
Sourcepub fn mark_ready(&self)
pub fn mark_ready(&self)
Mark application initialization complete. Drain always takes precedence.
Sourcepub fn snapshot(&self) -> Health
pub fn snapshot(&self) -> Health
Read a bounded snapshot without waiting for storage, writers or draining.
Sourcepub fn handle(&self, request: &Control) -> Result<Control>
pub fn handle(&self, request: &Control) -> Result<Control>
Handle a control request without admitting application work or waiting for drain.
Sourcepub async fn serve<S: AsyncRead + AsyncWrite + Unpin>(
&self,
stream: S,
offer: &Hello,
deadline: Instant,
) -> Result<()>
pub async fn serve<S: AsyncRead + AsyncWrite + Unpin>( &self, stream: S, offer: &Hello, deadline: Instant, ) -> Result<()>
Serve one authenticated connection under an absolute setup/control deadline. WATCH continues beyond setup, with a five-second deadline per event write.
No application operation is accepted here. The caller reserves control admission before invoking this method and drops the stream after an error.