Expand description
§teksilo-async-std — async-std reactor for Teksilo’s async executor
Thin adapter over teksilo-async. Unlike Tokio, async-std
runs a global reactor that starts lazily on first use, so no per-tick
runtime-context guard is needed: install_async_async_std() is exactly
install_async
plus the async-std dependency in the tree. Native async-std futures
(async_std::task::sleep, async-std sockets, …) can be .awaited directly
inside ctx.spawn_local(...) bodies — when a leaf future is ready, the
global reactor wakes the executor’s Waker and the loop ticks again.
ⓘ
use teksilo_async_std::TeksiloAppBuilderAsyncStdExt;
TeksiloAppBuilder::new().install_async_async_std() /* ... */ .run();
ctx.spawn_local(async move {
async_std::task::sleep(std::time::Duration::from_secs(1)).await;
status.set("done".into());
})
.detach();Structs§
- Task
Handle - Handle to a spawned task. Dropping it cancels the task (the future is
dropped on the next tick); call
detachto let the task run to completion independently of the handle.
Traits§
- Event
Context Async Ext - Spawn async work on the main-thread executor from inside an event handler.
- Teksilo
AppBuilder Async StdExt - Adds
install_async_async_stdto the app builder.
Functions§
- spawn_
blocking - Run
fon a dedicated OS thread and resolve to its return value. Await the returned future inside aspawn_localbody to keep heavy/blocking work off the UI thread: