Module runtime

Module runtime 

Source
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§

mpscNon-WebAssembly
Platform-independent mpsc channel A multi-producer, single-consumer queue for sending values between asynchronous tasks.
oneshotNon-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 a Sender and Receiver handle pair that form the channel.

Structs§

RwLock
Re-export tokio’s RwLock directly An asynchronous reader-writer lock.

Functions§

block_onNon-WebAssembly
Block on a future (only available on native)
sleep
Platform-independent sleep function
spawnNon-WebAssembly
Platform-independent spawn function On native: uses tokio::spawn On WASM: uses wasm_bindgen_futures::spawn_local (single-threaded)

Type Aliases§

JoinHandleNon-WebAssembly
JoinHandle for native platforms
MutexNon-WebAssembly
Platform-independent mutex