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>
impl<D: ActionDispatcher> ActionExecutor<D>
Sourcepub fn new(
actions_rx: Receiver<PendingAction>,
config: Arc<MeshOsConfig>,
dispatcher: Arc<D>,
) -> Self
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).
Sourcepub fn with_failure_appender(
self,
appender: Arc<dyn FailureChainAppender>,
) -> Self
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.
Sourcepub fn recent_failures_handle(&self) -> Arc<RwLock<VecDeque<FailureRecord>>> ⓘ
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.
Sourcepub fn failure_seq_handle(&self) -> Arc<AtomicU64> ⓘ
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.
Sourcepub fn failure_appender_handle(&self) -> Arc<dyn FailureChainAppender> ⓘ
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.
Sourcepub fn with_chain_appender(self, appender: Arc<dyn ActionChainAppender>) -> Self
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.
Sourcepub fn handle(&self) -> ExecutorHandle
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.
Sourcepub fn stats_arc(&self) -> Arc<ExecutorStats> ⓘ
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.
Sourcepub async fn run(self) -> Arc<ExecutorStats> ⓘ
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.