Skip to main content

Coordination

Struct Coordination 

Source
pub struct Coordination<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Coordination<'a>

Source

pub fn new(store: &'a mut Store) -> Self

Source

pub fn claim( &mut self, claim: &ClaimRequest<'_>, now_ms: i64, ) -> Result<Claim, StoreError>

Source

pub fn renew( &mut self, ticket_id: &str, run_id: &str, lease_ms: i64, now_ms: i64, ) -> Result<Renewal, StoreError>

Source

pub fn readopt( &mut self, ticket_id: &str, run_id: &str, lease_ms: i64, now_ms: i64, ) -> Result<Renewal, StoreError>

Re-arms the lease of a run recovery has just adopted, accepting a lease that expired while this daemon was down. Denied for a run that has already settled.

Source

pub fn start( store: &Store, start: &RunStart<'_>, now_ms: i64, ) -> Result<Start, StoreError>

Turns a claimed run running once its agent process exists.

Takes the store by shared reference: the transition needs no exclusive connection state, and the runner’s stage hooks that call it hold only a shared borrow. It is an associated function for that reason alone — the coordination boundary is the same.

Source

pub fn record_exit( &mut self, exit: &RunExit<'_>, now_ms: i64, ) -> Result<Exit, StoreError>

Checkpoints an agent’s exit, granting the caller ownership of aftercare. The supervisor and crash recovery may both attempt this; exactly one is granted.

Source

pub fn abandon( &mut self, run_id: &str, ticket_id: &str, now_ms: i64, ) -> Result<(), StoreError>

Source

pub fn settle( &mut self, run_id: &str, ticket_id: &str, exit_code: Option<i32>, outcome: Outcome, evidence: &[EvidenceRecord], cooldown: Option<&CooldownUpdate<'_>>, now_ms: i64, ) -> Result<bool, StoreError>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Coordination<'a>

§

impl<'a> !Sync for Coordination<'a>

§

impl<'a> !UnwindSafe for Coordination<'a>

§

impl<'a> Freeze for Coordination<'a>

§

impl<'a> Send for Coordination<'a>

§

impl<'a> Unpin for Coordination<'a>

§

impl<'a> UnsafeUnpin for Coordination<'a>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.