1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 FernTech
//! # teksilo-async-std — async-std reactor for Teksilo's async executor
//!
//! Thin adapter over [`teksilo-async`](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`](teksilo_async::TeksiloAppBuilderAsyncExt::install_async)
//! plus the async-std dependency in the tree. Native async-std futures
//! (`async_std::task::sleep`, async-std sockets, …) can be `.await`ed 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.
//!
//! ```ignore
//! 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();
//! ```
use TeksiloAppBuilder;
use TeksiloAppBuilderAsyncExt;
// Re-export the spawn surface so `use teksilo_async_std::*;` is enough for
// crate users that don't go through the `teksilo` umbrella prelude.
pub use ;
/// Adds [`install_async_async_std`](TeksiloAppBuilderAsyncStdExt::install_async_async_std)
/// to the app builder.