Skip to main content

Crate proxima_runtime

Crate proxima_runtime 

Source
Expand description

Runtime trait surface. Abstract scheduling primitives that concrete runtimes (TokioPerCoreRuntime, PrimeRuntime, RayonBackgroundPool) implement.

The trait and value types live here, out of the proxima umbrella, so prime can be a separate crate without depending on it.

Re-exports§

pub use primitives::JoinError;
pub use primitives::JoinSetLike;
pub use primitives::LocalMutexLike;
pub use primitives::LocalNotifyLike;
pub use primitives::MutexLike;
pub use primitives::NotifyLike;
pub use primitives::LocalRuntimeFactory;
pub use primitives::RuntimeFactory;

Modules§

ext
Fluent spawn surface over the object-safe Runtime. Carries the axis combinations the trait’s named methods pre-combine. Fluent surface over Runtime, carrying the combinations the trait’s named methods pre-combine.
primitives
RuntimeFactory sibling trait + the *Like primitive shapes.

Structs§

CoreId
Identifier for a pinned core in the runtime. Opaque; not assumed to map 1:1 onto OS CPU ids. Construction is implementation-specific.

Enums§

SpawnError
Failure modes for cross-core spawn dispatch. Surfaced by Runtime::spawn_on_core and Runtime::spawn_factory_on_core so callers must explicitly handle back-pressure rather than relying on silent drops — which was the cause of the inbox-saturation hang exposed by runtime_spawn_on_core_silently_drops_on_inbox_overflow in earlier versions.
SpawnRequest
Cross-core worker dispatch message used by Runtime impls. Generic over an Inline extension type so prime’s typed-future fast path can add a variant (SendInline) carrying its InlineTask, while tokio’s per-core impl uses the default (Infallible) which makes the SendInline arm unreachable.

Traits§

BackgroundPool
Pluggable backend for cross-thread CPU-bound work.
Runtime
Per-core executor abstraction. Implementations select the concrete threading + I/O model:

Functions§

block_on
Drive future to completion on a Runtime you already HOLD, returning its output. The runtime-backed sibling of the no-runtime proxima_primitives::block_on poll loop: same verb (“drive a future to completion”), but the future runs on runtime’s core 0 worker instead of the calling thread. Composes Runtime::spawn_on_core with a sync_channel(1) for the thread-park / value handoff — the exact core of the edge run_prime driver, lifted off the concrete PrimeRuntime onto &dyn Runtime (a free fn, not a trait method, so dyn Runtime stays object-safe).
spawn_on_core_blocking_with
Loop on spawn_on_core until the future is accepted (Ok) or the target core is shut down (SpawnError::Disconnected). The factory closure is invoked once per attempt so the future is freshly constructed each time — necessary because spawn_on_core consumes the future on every call (including failures).

Type Aliases§

BackgroundHandle
Handle to a task running on the background work-stealing pool. The chain runtime stays per-core; this handle lets a Pipe await a CPU-bound side computation that does migrate between threads.