Skip to main content

Module runtime

Module runtime 

Source
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. WASM (Browser): wasm-bindgen-futuresspawn_local, no blocking threads.

Functions§

interval
Create a recurring interval timer.
now_millis
Get the current timestamp in milliseconds since Unix epoch.
now_secs
Get the current timestamp in seconds since Unix epoch.
sleep
Sleep for a duration.
spawn
Spawn a future on the runtime.
spawn_blocking
Run a blocking closure off the async runtime.