Skip to main content

BootstrappedEngine

Struct BootstrappedEngine 

Source
pub struct BootstrappedEngine<H: ExecutorHandler + 'static, C: Clock = SystemClock> { /* private fields */ }
Expand description

A bootstrapped engine ready for task submission and execution.

Implementations§

Source§

impl<H: ExecutorHandler + 'static, C: Clock> BootstrappedEngine<H, C>

Source

pub fn submit_task(&mut self, spec: TaskSpec) -> Result<(), EngineError>

Submits a new task specification for execution.

Source

pub async fn tick(&mut self) -> Result<TickResult, EngineError>

Advances the dispatch loop by one tick.

Source

pub async fn run_until_idle(&mut self) -> Result<RunSummary, EngineError>

Runs the dispatch loop until no work remains.

Source

pub fn projection(&self) -> &ReplayReducer

Returns a reference to the current projection state.

Source

pub fn declare_dependency( &mut self, task_id: TaskId, prereqs: Vec<TaskId>, ) -> Result<(), EngineError>

Declares a DAG dependency.

Source

pub async fn drain_and_shutdown( self, timeout: Duration, ) -> Result<(), EngineError>

Gracefully drains in-flight work and then shuts down.

Stops promoting and dispatching new work, but continues processing in-flight results and heartbeating leases until all in-flight work completes or the timeout expires. The WAL writer is flushed and closed on drop of the underlying authority.

Source

pub fn shutdown(self) -> Result<(), EngineError>

Shuts down the engine immediately, consuming it.

In-flight workers will continue to completion in their tokio blocking tasks. Worker results for in-flight runs are lost; those runs will recover via lease expiry on the next bootstrap. The WAL writer is flushed and closed on drop of the underlying authority.

For orderly drain of in-flight work, use drain_and_shutdown() instead.

Auto Trait Implementations§

§

impl<H, C> Freeze for BootstrappedEngine<H, C>
where C: Freeze,

§

impl<H, C = SystemClock> !RefUnwindSafe for BootstrappedEngine<H, C>

§

impl<H, C> Send for BootstrappedEngine<H, C>

§

impl<H, C> Sync for BootstrappedEngine<H, C>

§

impl<H, C> Unpin for BootstrappedEngine<H, C>
where C: Unpin,

§

impl<H, C> UnsafeUnpin for BootstrappedEngine<H, C>
where C: UnsafeUnpin,

§

impl<H, C = SystemClock> !UnwindSafe for BootstrappedEngine<H, C>

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, 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.
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