Expand description
A 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.
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.
To get started using this library, please refer to the book. The Playground also has runnable examples.
Structs§
- Async
Join Handle IntoFutureimplementation forJoinHandle- Join
Handle - Handle for joining a thread
- Thread
Dispatcher Init - Thread dispatcher initialization.
Enums§
- Spawn
Error - Thread creation error returned by
try_spawnortry_spawn_async
Functions§
- init_
bg_ no_ modules - Start building a thread dispatcher using the bindgen script from the “no-modules” target.
See
ThreadDispatcherInit - init_
bg_ web - Start building a thread dispatcher using the bindgen script from the “web” target.
See
ThreadDispatcherInit - spawn
- Spawn a new thread similar to
std::thread::spawn - spawn_
async - Spawn a new thread that runs co-operatively with the JS event loop.
- spawn_
local - Schedule a task in the JS Event Loop to drive the Rust future.
- terminate_
dispatcher - Terminate the thread dispatcher worker
- try_
spawn - Same as
spawnbut captures thread creation failure. - try_
spawn_ async - Same as
spawn_asyncbut captures thread creation failure.