Struct AgentLifecycleCoordinator
pub struct AgentLifecycleCoordinator { /* private fields */ }Expand description
Coordinates slow session admission with destructive alias mutations.
Implementations§
Source§impl AgentLifecycleCoordinator
impl AgentLifecycleCoordinator
Sourcepub fn reserve_config_mutation(
&self,
alias: impl Into<String>,
) -> Result<AgentAdmissionReservation, AgentAdmissionError>
pub fn reserve_config_mutation( &self, alias: impl Into<String>, ) -> Result<AgentAdmissionReservation, AgentAdmissionError>
Reserve an alias while a config property mutation is prepared and committed. This prevents delete/rename from crossing an autovivifying write without treating an ordinary config edit as destructive work.
Sourcepub fn reserve_config_write(
&self,
) -> Result<ConfigWriteLease, AgentAdmissionError>
pub fn reserve_config_write( &self, ) -> Result<ConfigWriteLease, AgentAdmissionError>
Retain one config write in this daemon generation. Unlike the alias-scoped reservations above, this lease also covers config writes that do not target an agent. Generation drain waits for every retained writer before transferring process ownership to its successor.
Sourcepub fn reserve_admission(
&self,
alias: impl Into<String>,
) -> Result<AgentAdmissionReservation, AgentAdmissionError>
pub fn reserve_admission( &self, alias: impl Into<String>, ) -> Result<AgentAdmissionReservation, AgentAdmissionError>
Reserve an alias generation before slow agent construction starts.
Sourcepub fn reserve_turn(
&self,
alias: impl Into<String>,
) -> Result<AgentTurnLease, AgentAdmissionError>
pub fn reserve_turn( &self, alias: impl Into<String>, ) -> Result<AgentTurnLease, AgentAdmissionError>
Admit one ordinary message turn without pinning an idle connection.
Sourcepub fn alias_generation(&self, alias: &str) -> u64
pub fn alias_generation(&self, alias: &str) -> u64
Return the current generation token for a persistent turn producer.
Sourcepub fn reserve_turn_at(
&self,
alias: impl Into<String>,
generation: u64,
) -> Result<AgentTurnLease, AgentAdmissionError>
pub fn reserve_turn_at( &self, alias: impl Into<String>, generation: u64, ) -> Result<AgentTurnLease, AgentAdmissionError>
Admit a turn only when its persistent producer still targets the same alias generation it was constructed for.
Sourcepub fn begin_delete(
&self,
alias: impl Into<String>,
) -> Result<AgentDeleteLease, AgentDeleteBlocker>
pub fn begin_delete( &self, alias: impl Into<String>, ) -> Result<AgentDeleteLease, AgentDeleteBlocker>
Reserve destructive work for one alias after proving no admission or
published session is using it. The reservation blocks new admission by
marking the alias changing, but does not advance the alias generation:
a refused or failed mutation drops the lease and leaves existing
producers usable. Only after the config mutation is durably committed
does the caller call AgentDeleteLease::commit_destructive_mutation,
which advances the generation exactly once and hands destructive
ownership to the retained continuation.
pub fn delete_blocker(&self, alias: &str) -> Option<AgentDeleteBlocker>
pub fn live_session_count(&self, alias: &str) -> usize
pub fn active_turn_count(&self, alias: &str) -> usize
Sourcepub fn close_generation(&self)
pub fn close_generation(&self)
Prevent this generation from admitting new sessions, turns, or destructive work before ingress shutdown begins.
Trait Implementations§
Source§impl Clone for AgentLifecycleCoordinator
impl Clone for AgentLifecycleCoordinator
Source§fn clone(&self) -> AgentLifecycleCoordinator
fn clone(&self) -> AgentLifecycleCoordinator
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for AgentLifecycleCoordinator
impl Default for AgentLifecycleCoordinator
Source§fn default() -> AgentLifecycleCoordinator
fn default() -> AgentLifecycleCoordinator
Auto Trait Implementations§
impl !RefUnwindSafe for AgentLifecycleCoordinator
impl !UnwindSafe for AgentLifecycleCoordinator
impl Freeze for AgentLifecycleCoordinator
impl Send for AgentLifecycleCoordinator
impl Sync for AgentLifecycleCoordinator
impl Unpin for AgentLifecycleCoordinator
impl UnsafeUnpin for AgentLifecycleCoordinator
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more