Expand description
Runtime abstraction layer for platform-independent async execution
This module provides abstractions that work on both native platforms (using tokio) and WASM/WASI environments (using wasm-bindgen-futures or single-threaded execution).
Modules§
- mpsc
Non-WebAssembly - Platform-independent mpsc channel A multi-producer, single-consumer queue for sending values between asynchronous tasks.
- oneshot
Non-WebAssembly - Platform-independent oneshot channel
A one-shot channel is used for sending a single message between
asynchronous tasks. The
channel
function is used to create aSender
andReceiver
handle pair that form the channel.
Structs§
- RwLock
- Re-export tokio’s
RwLock
directly An asynchronous reader-writer lock.
Functions§
- block_
on Non-WebAssembly - Block on a future (only available on native)
- sleep
- Platform-independent sleep function
- spawn
Non-WebAssembly - Platform-independent spawn function
On native: uses
tokio::spawn
On WASM: useswasm_bindgen_futures::spawn_local
(single-threaded)
Type Aliases§
- Join
Handle Non-WebAssembly JoinHandle
for native platforms- Mutex
Non-WebAssembly - Platform-independent mutex