wasm-bindgen/examples/raytrace-parallel
Ingvar Stepanyan 46cbd19e60 Improve worker.js reliability (#1820)
While it doesn't happen right now in this particular example, `lastPtr` can be potentially overridden several times before the module is fully initialised.

Rather than having a boolean and a storage for one last argument, `await` a promise returned from `wasm_bindgen` itself in the new `onmessage` handler before executing actual command.

This way all the potential tasks will queue up naturally, wait for the initialisation, and then execute in a correct order.
2019-10-17 17:29:37 -05:00
..
src Don't offset the number of rayon workers by 1 2019-10-01 18:10:18 -07:00
.gitignore Implement the local JS snippets RFC 2019-03-05 08:00:47 -08:00
build.sh Switch to Cargo's -Zbuild-std for building libstd (#1796) 2019-09-26 12:32:50 -05:00
Cargo.toml Bump to 0.2.51 (#1797) 2019-09-26 14:07:28 -05:00
index.html Update idioms of a few examples 2019-02-19 13:27:30 -08:00
index.js Rewrite the parallel raytracing example with rayon 2019-06-13 06:48:53 -07:00
README.md docs: update docs link 2019-05-26 16:43:00 +09:00
worker.js Improve worker.js reliability (#1820) 2019-10-17 17:29:37 -05:00

Parallel Raytracing

View documentation for this example online or View compiled example online

You can build the example locally with:

$ ./build.sh

(or running the commands on Windows manually)

and then visiting http://localhost:8080 in a browser should run the example!