Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@
//! Enabling any other feature (including `full`) will cause a compilation
//! failure.
//!
//! When using `WASM` with multiple threads, support for blocking calls is
//! required. This means that, for example, using a Tokio mpsc channel to send
//! messages from a web worker to the main browser context will not work, as the
//! main browser context does not support blocking.
//!
//! The `time` module will only work on `WASM` platforms that have support for
//! timers (e.g. wasm32-wasi). The timing functions will panic if used on a `WASM`
//! platform that does not support timers.
Expand Down
6 changes: 6 additions & 0 deletions tokio/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,12 @@
//! As an exception, methods ending in `_timeout` are not runtime agnostic
//! because they require access to the Tokio timer. See the documentation of
//! each `*_timeout` method for more information on its use.
//!
//! This module is also compatible with WASM, with one caveat: Tokio may use
//! blocking operations when more than one thread is involved. This means that,
//! for example, using a Tokio mpsc channel to send messages from a web worker
//! to the main browser context will not work, as the main browser context does
//! not support blocking operations.

cfg_sync! {
/// Named future types.
Expand Down
Loading