Expand description
Utilities to work with web workers and rayon.
Macros§
- console_
log - Macro allowing to write to the js/browser’s console. You must import web_worker::log into scope to use this macro.
Structs§
- Worker
Pool - The
WorkerPool
. This is a special type of thread pool that works on wasm and provide a way to run work they way rayon does it.
Functions§
- child_
entry_ point - Entry point invoked by
worker.js
, a bit of a hack but see the “TODO” above aboutworker.js
in general. - default_
thread_ pool - Creates a new
rayon::ThreadPool
with default concurrency value provided by the browser - init_
panic_ hook - Initializes the logging of panics originating from the rust code. Must be called once at the start of the execution.
- log
- External binding to the js console.log method. You probably want to use console_log!() instead of this.
- new_
thread_ pool - Creates a new
rayon::ThreadPool
from the provided WorkerPool (created in the javascript code) and the concurrency value, which indicates the number of threads to use.