Skip to main content

Crate moirai_executor

Crate moirai_executor 

Source
Expand description

§Hybrid Executor Implementation

This crate provides a high-performance hybrid executor that combines synchronous, asynchronous, and blocking execution on one unified scheduler facade. Synchronous and async-ready work use the compute work-stealing pool; potentially blocking work uses a lazily initialized, bounded lane owned by that scheduler.

§Architecture Overview

  • Static Work-Class Routing: sync, async, and blocking jobs are routed by zero-sized work-class markers; blocking admission is isolated from the compute worker pool.
  • Priority-Partitioned Queues: per-worker Chase-Lev deques indexed by moirai_core::Priority::index.
  • Zero-Copy Task Passing: minimal overhead task distribution.

Re-exports§

pub use hybrid::HybridExecutor;
pub use metrics::ExecutorMetrics;
pub use registry::RetentionPolicy;
pub use registry::TaskRegistry;
pub use schedule::AcceleratorCounts;
pub use schedule::AcceleratorId;
pub use schedule::AcceleratorKind;
pub use schedule::AcceleratorRoute;
pub use schedule::AcceleratorRoutePolicy;
pub use schedule::AsyncLaneId;
pub use schedule::AsyncLanesPerProcess;
pub use schedule::AsyncTask;
pub use schedule::BlockingTask;
pub use schedule::HybridRoutePolicy;
pub use schedule::HybridRouter;
pub use schedule::IdleHook;
pub use schedule::IdleHookRegistrationError;
pub use schedule::MAX_IDLE_HOOKS;
pub use schedule::ProcessCount;
pub use schedule::ProcessId;
pub use schedule::ProcessRoute;
pub use schedule::RoutePolicy;
pub use schedule::RouteSummary;
pub use schedule::RouteTopology;
pub use schedule::ScheduleMetrics;
pub use schedule::SchedulerRoute;
pub use schedule::SchedulerScope;
pub use schedule::ServerCount;
pub use schedule::ServerId;
pub use schedule::ServerRoute;
pub use schedule::ServerRoutePolicy;
pub use schedule::SyncTask;
pub use schedule::ThreadId;
pub use schedule::ThreadRoute;
pub use schedule::ThreadRoutePolicy;
pub use schedule::ThreadScheduler;
pub use schedule::WorkClass;
pub use schedule::WorkerCount;
pub use schedule::register_idle_hook;
pub use schedule::run_idle_hooks;
pub use task::TaskMetadata;

Modules§

hybrid
Main hybrid executor implementation.
metrics
Performance metrics and monitoring for the executor system.
registry
Task registry for tracking and managing task lifecycle.
schedule
Unified executor scheduling.
task
Task management and execution abstractions.

Structs§

ExecutorBuilder
Main executor builder for creating configured instances

Functions§

block_on
Block the current thread until future resolves.
global
Borrow the shared, lazily-initialized process-wide executor.
initialize
Initialize the shared executor and install its Melinoe partition bridge.
shared
Obtain an owned handle to the shared process-wide executor.