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 overRuntime, carrying the combinations the trait’s named methods pre-combine. - primitives
RuntimeFactorysibling trait + the*Likeprimitive 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§
- Spawn
Error - Failure modes for cross-core spawn dispatch. Surfaced by
Runtime::spawn_on_coreandRuntime::spawn_factory_on_coreso callers must explicitly handle back-pressure rather than relying on silent drops — which was the cause of the inbox-saturation hang exposed byruntime_spawn_on_core_silently_drops_on_inbox_overflowin earlier versions. - Spawn
Request - Cross-core worker dispatch message used by
Runtimeimpls. Generic over anInlineextension type so prime’s typed-future fast path can add a variant (SendInline) carrying itsInlineTask, while tokio’s per-core impl uses the default (Infallible) which makes theSendInlinearm unreachable.
Traits§
- Background
Pool - 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
futureto completion on aRuntimeyou already HOLD, returning its output. The runtime-backed sibling of the no-runtimeproxima_primitives::block_onpoll loop: same verb (“drive a future to completion”), but the future runs onruntime’s core 0 worker instead of the calling thread. ComposesRuntime::spawn_on_corewith async_channel(1)for the thread-park / value handoff — the exact core of the edgerun_primedriver, lifted off the concretePrimeRuntimeonto&dyn Runtime(a free fn, not a trait method, sodyn Runtimestays object-safe). - spawn_
on_ core_ blocking_ with - Loop on
spawn_on_coreuntil 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 becausespawn_on_coreconsumes the future on every call (including failures).
Type Aliases§
- Background
Handle - 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.