Expand description
Platform-specific async runtime abstractions.
NodeDB-Lite compiles for native (Tokio) and WASM (wasm-bindgen-futures).
This module provides a thin abstraction over the differences so engine
code doesn’t need #[cfg] everywhere.
Native (iOS/Android/Desktop): Tokio — spawn, spawn_blocking, sleep, interval.
WASM (Browser): wasm-bindgen-futures + gloo-timers — spawn_local, no blocking
threads, timer-backed sleep and interval.
Structs§
- Interval
- A recurring interval timer.
- Task
Handle - Handle to a task started by
spawn.
Functions§
- interval
- Create a recurring interval timer that ticks every
period. - monotonic_
millis_ i64 - Get a strictly-monotonic system timestamp in milliseconds since Unix epoch.
- now_
millis - Get the current timestamp in milliseconds since Unix epoch.
- now_
millis_ i64 - Get the current timestamp in milliseconds since Unix epoch, as
i64. - now_
secs - Get the current timestamp in seconds since Unix epoch.
- sleep
- Sleep for a duration.
- spawn
- Spawn a future on the runtime, returning a handle to the running task.
- spawn_
blocking - Run a blocking closure off the async runtime.