yielding-executor

Crates.ioyielding-executor
lib.rsyielding-executor
version0.10.0
sourcesrc
created_at2022-06-30 16:40:13.786755
updated_at2022-06-30 16:40:13.786755
descriptionAsync executor with configurable yielding
homepage
repositoryhttps://github.com/wasmflow/yielding-executor
max_upload_size
id616498
size43,921
Jarrod Overson (jsoverson)

documentation

https://docs.rs/yielding-executor

README

Yielding Executor for WebAssembly

Crate API

This executor is a fork of wasm-rs-async-executor decoupled from wasm-bindgen.

There are a number of async task executors available in Rust's ecosystem. However, most (if not all?) of them rely on primitives that might not be available or optimal for WebAssembly deployment at the time and rely on the ability to monopolize a thread until completion. This crate gives you a simple executor that you can configure to yield in arbitrary ways.

Usage

Include this dependency in your Cargo.toml:

[dependencies]
yielding-executor = "0.9.0"

yielding-executor is expected to work on stable Rust, 1.49.0 and higher up.

Supported targets

This crate passes tests for wasm32-unknown-unknown and wasm32-wasi targets and should not really be used for anything else. There are better executors for other targets.

Notes

Please note that this library hasn't received much analysis in terms of safety and soundness. Some of the caveats related to that might never be resolved completely. This is an ongoing development and the maintainer is aware of potential pitfalls. Any productive reports of unsafeties or unsoundness are welcomed (whether they can be resolved or simply walled with unsafe for end-user to note).

License

Licensed under either of

Commit count: 100

cargo fmt