Skip to main content

Module task

Module task 

Source
Expand description

proxima_primitives::sync::task — runtime-agnostic task primitives shaped like tokio::task. Folded from the former proxima-task crate (Workstream F, RISC-dedup) so other proxima leaf crates (proxima-middleware, proxima-listeners-*, prime, etc.) reach it via the same crate as the rest of proxima’s concurrency surface, without circling back through the top-level proxima crate.

Surface:

  • yield_now — cooperative scheduling hook. Pure re-export of futures::task::yield_now; runtime-agnostic.
  • JoinSet — under runtime-tokio, a thin newtype over tokio::task::JoinSet. Without it (the default, tokio-free build), a portable backing: one OS thread per spawned task running futures::executor::block_on, with completions delivered through an mpsc channel + Notify so join_next stays a non-blocking .await. Real independent background progress without depending on the caller’s async runtime — the same functional contract as tokio’s JoinSet, minus true task abortion (an OS thread can’t be forcibly stopped; abort_all stops waiting on outstanding tasks instead).

Structs§

AbortHandle
No-op marker kept for call-site parity with tokio::task::AbortHandle — an OS thread cannot be forcibly stopped from the outside.
JoinError
Mirrors tokio::task::JoinError’s query surface — the only part ProducerLifecycle reads.
JoinSet
Tokio-free task set. See module docs for the execution model.
YieldNow
Future returned by yield_now. Named so callers can store it.

Functions§

yield_now
Cooperative yield. The returned future yields exactly once on first poll (Pending + waker-poke), then resolves on the next poll. Same semantic as tokio::task::yield_now, runtime-agnostic.