wasm-bindgen/examples/raytrace-parallel
Alex Crichton 3c887c40b7
Default all async support to std::future (#1741)
This commit defaults all crates in-tree to use `std::future` by default
and none of them support the crates.io `futures` 0.1 crate any more.
This is a breaking change for `wasm-bindgen-futures` and
`wasm-bindgen-test` so they've both received a major version bump to
reflect the new defaults. Historical versions of these crates should
continue to work if necessary, but they won't receive any more
maintenance after this is merged.

The movement here liberally uses `async`/`await` to remove the need for
using any combinators on the `Future` trait. As a result many of the
crates now rely on a much more recent version of the compiler,
especially to run tests.

The `wasm-bindgen-futures` crate was updated to remove all of its
futures-related dependencies and purely use `std::future`, hopefully
improving its compatibility by not having any version compat
considerations over time. The implementations of the executors here are
relatively simple and only delve slightly into the `RawWaker` business
since there are no other stable APIs in `std::task` for wrapping these.

This commit also adds support for:

    #[wasm_bindgen_test]
    async fn foo() {
        // ...
    }

where previously you needed to pass `(async)` now that's inferred
because it's an `async fn`.

Closes #1558
Closes #1695
2019-09-05 11:18:36 -05:00
..
src Default all async support to std::future (#1741) 2019-09-05 11:18:36 -05:00
.gitignore Implement the local JS snippets RFC 2019-03-05 08:00:47 -08:00
build.sh Fully update threading support for LLVM 9 2019-07-30 09:17:23 -07:00
Cargo.toml Default all async support to std::future (#1741) 2019-09-05 11:18:36 -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 Rewrite the parallel raytracing example with rayon 2019-06-13 06:48:53 -07:00
Xargo.toml Fully update threading support for LLVM 9 2019-07-30 09:17:23 -07: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!