Skip to main content

Crate geph5_rt

Crate geph5_rt 

Source
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::immortal on 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::reaper on top of crate::Task.

Structs§

Task
A cancel-on-drop task handle, mirroring smol::Task.

Traits§

TimeoutExt
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 rdr into a thread-local buffer, returning the bytes read.
pooled_read_callback
Like pooled_read, but instead of allocating, invokes resolve on 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.