wasm-futures-executor
worktank
wasm-futures-executor | worktank | |
---|---|---|
3 | 1 | |
29 | 34 | |
- | - | |
0.0 | 6.6 | |
almost 2 years ago | 28 days ago | |
Rust | TypeScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wasm-futures-executor
-
How to enable Bulk Memory Operations when compiling to WebAssembly?
RUSTFLAGS='-C target-feature=+bulk-memory' should work according to the readme of https://github.com/wngr/wasm-futures-executor
-
Threading for WASM target
I recommend using it through the wasm-futures-executor crate: https://github.com/wngr/wasm-futures-executor.
-
Web Crypto API
By the way, I built something similar (?): A Rust library that mimics the API of the `futures-executor` crate, but each worker thread is a single WebWorker.
https://github.com/wngr/wasm-futures-executor
worktank
-
Web Crypto API
Workers are awesome but you are right, working with them can be painful without the right tooling.
Personally I've written my own libraries for abstracting all this away and I've having a blast working with workers now, maybe check them out:
- WorkTank [1]: This abstracts away the difference between browser workers and Node worker threads, it makes it easy to make worker pools, and it can transfer simple functions to a worker at runtime too.
- WorkTank loader: This abstracts away loading asynchronous function from a worker basically, you just add ".worker" to your file name and that file and all its dependencies are transparently replaced moved to a worker, all the rest of the app (TS types for example) doesn't even notice anything happened, it just works.
You might want to check out the more popular "comlink" library too, although it didn't work for me for whatever reason and it doesn't support worker pools I believe.
[1]: https://github.com/fabiospampinato/worktank
[2]: https://github.com/fabiospampinato/worktank-loader
What are some alternatives?
wireworld-player - A multithreaded web app for loading and simulating instances of the Wireworld cellular automaton
objectbuffer - JavaScript Object like api, backed by an arraybuffer
yew - Rust / Wasm framework for creating reliable and efficient web applications
worktank-loader - WebPack plugin for WorkTank which enables you to execute whole files in a worker pool, transparently.
pasts - Minimal and simpler alternative to the futures crate.
main-thread-scheduling - Fast and consistently responsive apps using a single function call
rinzler - An autonomous parallel processing engine for the browser.
comlink - Comlink makes WebWorkers enjoyable.