Expand description
tokio-based runtime helpers for geph5.
This crate replaces the smol/smolscale runtime surface (spawning, blocking,
timeouts, the immortal/respawn pattern, and the task reaper) while preserving
the property the codebase relies on for structured concurrency: smol’s
Task<T> cancels the task when the handle is dropped. tokio’s
JoinHandle detaches on drop instead, so Task reintroduces drop-cancel.
Re-exports§
pub use immortal::Immortal;pub use immortal::RespawnStrategy;pub use reaper::TaskReaper;
Modules§
- immortal
- Long-lived, auto-restarting tasks. A faithful reimplementation of
smolscale::immortalon top of the global tokio runtime. - reaper
- A task “reaper” that cancels everything it owns when dropped, yet does not
leak handles to tasks that have already finished. A faithful reimplementation
of
smolscale::reaperon top ofcrate::Task.
Structs§
- Task
- A cancel-on-drop task handle, mirroring
smol::Task.
Traits§
- Timeout
Ext - Extension trait adding a
.timeout(duration)combinator to any future.
Functions§
- block_
on - Blocks the current thread on a future, driving it on the global runtime.
- handle
- Returns a cloneable handle to the global runtime.
- pooled_
read - Reads from
rdrinto a thread-local buffer, returning the bytes read. - pooled_
read_ callback - Like
pooled_read, but instead of allocating, invokesresolveon the freshly read bytes (still backed by the thread-local buffer). - spawn
- Spawns a future onto the global runtime, returning a cancel-on-drop handle.
- spawn_
blocking - Runs a blocking closure on the global runtime’s blocking pool.