Skip to main content

ControlService

Struct ControlService 

Source
pub struct ControlService { /* private fields */ }
Expand description

One process’s lifecycle control, independent of application capacity and I/O.

Implementations§

Source§

impl ControlService

Source

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.

Source

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

Source

pub fn new( lifecycle: Arc<Lifecycle>, generation: u64, build: String, revision: u64, ) -> Self

Start in the initializing state. The consumer marks readiness explicitly.

Source

pub fn mark_ready(&self)

Mark application initialization complete. Drain always takes precedence.

Source

pub fn snapshot(&self) -> Health

Read a bounded snapshot without waiting for storage, writers or draining.

Source

pub fn handle(&self, request: &Control) -> Result<Control>

Handle a control request without admitting application work or waiting for drain.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.