Skip to main content

ActionExecutor

Struct ActionExecutor 

Source
pub struct ActionExecutor<D: ActionDispatcher> { /* private fields */ }
Expand description

The executor task body. Owns:

  • the receiver side of the loop’s action queue,
  • a BackpressureState (Phase G),
  • the dispatcher,
  • the deferred-retry heap.

Construct via ActionExecutor::new; drive via ActionExecutor::run.

Implementations§

Source§

impl<D: ActionDispatcher> ActionExecutor<D>

Source

pub fn new( actions_rx: Receiver<PendingAction>, config: Arc<MeshOsConfig>, dispatcher: Arc<D>, ) -> Self

Build an executor. actions_rx is the loop’s queue (returned by super::event_loop::MeshOsLoop::new).

Source

pub fn with_failure_appender( self, appender: Arc<dyn FailureChainAppender>, ) -> Self

Attach a super::failure_chain::FailureChainAppender. The executor’s record_failure path dual-writes every failure to both the in-memory ring (snapshot readable) and this appender (chain-backed history). Without an explicit appender the executor uses the no-op default.

Source

pub fn recent_failures_handle(&self) -> Arc<RwLock<VecDeque<FailureRecord>>>

Clone the shared recent-failures ring. The runtime hands this to the loop so the snapshot publish path can copy it into the super::snapshot::MeshOsSnapshot::recent_failures field — the chain-fold path is not the only failure surface.

Source

pub fn failure_seq_handle(&self) -> Arc<AtomicU64>

Clone the shared failure-seq counter. The loop side records its own failures (e.g. migration-abort dispatcher errors) and needs the same monotonic sequence so SDK consumers’ dedup gate doesn’t see colliding seq values.

Source

pub fn failure_appender_handle(&self) -> Arc<dyn FailureChainAppender>

Clone the shared failure-chain appender. The loop side dual-writes records via its internal record_runtime_failure helper so the durable chain history covers loop-side failures too, not just executor-side dispatch failures.

Source

pub fn with_chain_appender(self, appender: Arc<dyn ActionChainAppender>) -> Self

Builder: install an action-chain appender. The default NoOpActionChainAppender swallows every record; a real appender (e.g. one writing to a RedEX chain consumed by MeshOsSnapshotFold) takes over per-action recording.

Source

pub fn handle(&self) -> ExecutorHandle

Handle on the executor’s live state — stats + the recent-failures snapshot. Cheap to clone (Arc / fixed-size copies). Useful for Phase F snapshot building from outside the task.

Source

pub fn stats_arc(&self) -> Arc<ExecutorStats>

Clone the stats Arc. Useful for the super::runtime::MeshOsRuntime stitching layer, which holds the Arc across run()’s consumption of self.

Source

pub async fn run(self) -> Arc<ExecutorStats>

Drive the executor until either the action receiver closes (the loop dropped its sender) or the inner dispatcher panics. Returns the accumulated stats.

Auto Trait Implementations§

§

impl<D> !RefUnwindSafe for ActionExecutor<D>

§

impl<D> !UnwindSafe for ActionExecutor<D>

§

impl<D> Freeze for ActionExecutor<D>

§

impl<D> Send for ActionExecutor<D>

§

impl<D> Sync for ActionExecutor<D>

§

impl<D> Unpin for ActionExecutor<D>

§

impl<D> UnsafeUnpin for ActionExecutor<D>

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