Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

wasm-bindgen-spawn

version badge license badge issues badge

wasm-bindgen-spawn is a Web Worker based multithreading library for Rust and WebAssembly.

This uses the WebAssembly threads proposal and shared memory to communicate between workers (once they are started), instead of postMessage. The threads proposal is currently in phase 4 and available in all major browsers and runtimes.

Note

This library will remain on version 0.0.x until all features required are in stable Rust, standardized in WASM, and baseline widely available across browsers.

Caution

Rust and wasm-bindgen frequently change the RUSTFLAGS needed to compile with threading support enabled. If you cannot build with configs given in this guide, please open an issue on GitHub.

Caution

Ensure you are using a supported version of the tools and engines. We are working at the very cutting edge. Most tools require the latest version or even building from source for unreleased bug fixes.

Getting Started

  • See Support Matrix for the toolchains, JS engine, and wasm-pack target support.
  • See Setup Guide for how to setup your project to use this library.
  • See Playground for runnable examples that also link to the example source code on GitHub.
  • The remaining chapters of the book cover basic usage of the library. for advanced technical reference, see the API documention on docs.rs

Special thanks