diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 6b0f48bd105..74bc3b916b8 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -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. diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index 3a6c8b8270c..a7a8af88632 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -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.