Skip to main content

LifecycleLauncher

Struct LifecycleLauncher 

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

Production implementation of e1’s launcher port.

Implementations§

Source§

impl LifecycleLauncher

Source

pub fn new( host_id: HostId, app_paths: AppPaths, diagnostics_root: impl Into<PathBuf>, runner_group_id: u64, timeouts: RecoveryTimeouts, retry: RetryPolicy, ports: LifecyclePorts, ) -> Self

Source

pub fn with_preparation_turns(self, turns: Arc<Semaphore>) -> Self

Takes turns to prepare with every launcher holding turns, rather than only with itself: the targets of one host.

Source

pub async fn recover_startup( &self, policies: &[ScalePolicy], ) -> Result<Vec<ReplacementIntent>, LifecycleError>

Reconcile the entire journal before allowing a launch. Unknown-policy attempts are left untouched rather than being acted on without an ownership proof.

Source

pub async fn supervise( &self, policy: &ScalePolicy, ) -> Result<Vec<ReplacementIntent>, LifecycleError>

Supervise all attempts of one policy during an ordinary poll.

Trait Implementations§

Source§

impl Debug for LifecycleLauncher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RunnerLauncher for LifecycleLauncher

Source§

fn host_capacity<'life0, 'life1, 'async_trait>( &'life0 self, host: &'life1 Host, ) -> Pin<Box<dyn Future<Output = Result<NonZeroU16, HostCapacityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read this host’s current ceiling from the journal, including edits made after daemon startup. An unreadable or missing host is an error, never permission to fall back to the startup ceiling.
Source§

fn supervise<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 ScalePolicy, ) -> Pin<Box<dyn Future<Output = Result<Vec<ReplacementIntent>, LaunchFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Reconcile this policy’s existing processes before demand is read and capacity is recomputed. A concluded pre-acceptance attempt thereby becomes an ordinary allocation candidate in this same pass; replacement never bypasses the allocator.
Source§

fn attempts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunnerAttempt>, LaunchFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Every attempt this host holds, across every policy, terminal ones included. Read more
Source§

fn launch<'life0, 'life1, 'async_trait>( &'life0 self, request: LaunchRequest<'life1>, ) -> Pin<Box<dyn Future<Output = Result<RunnerAttempt, LaunchFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create exactly one runtime and start one runner, and return the attempt that now exists. Read more
Source§

fn finish_launch<'life0, 'life1, 'async_trait>( &'life0 self, policy: &'life1 ScalePolicy, attempt: RunnerAttempt, lock_wait: Duration, ) -> Pin<Box<dyn Future<Output = Result<RunnerAttempt, LaunchFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bring up a runner Self::launch reserved, after the host allocation lock was released: its package, its registration and its process, none of which decides a ceiling, and all of which may take minutes. Read more
Source§

fn clean<'life0, 'async_trait>( &'life0 self, id: AttemptId, ) -> Pin<Box<dyn Future<Output = Result<(), LaunchFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a terminal attempt’s runtime and mark it cleaned. Read more

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more