Cargo Features

poll-promise has no features set by default.

[dependencies]
poll-promise = { version = "0.3.0", features = ["async-std", "smol", "smol_tick_poll", "tokio", "web"] }
async-std

If you enable the async-std feature you can use Promise::spawn_async and Promise::spawn_blocking which will spawn tasks in the surrounding async-std runtime.

Enables async-std

smol

If you enable the smol feature you can use Promise::spawn_async and Promise::spawn_local which will spawn tasks using the smol executor. Remember to tick the smol executor with tick and tick_local.

Enables smol ^1.2.5

Affects poll-promise::tick, poll-promise::tick_local

smol_tick_poll

Enabling the smol_tick_poll feature (together with smol) calling Promise::poll will automatically tick the smol executor. This means you do not have to worry about calling tick but comes at the cost of loss of finer control over the executor.

Since calling tick_local will block the current thread, running multiple local promises at once with smol_tick_poll enabled may also cause stuttering.

poll-promise will automatically tick the smol executor with this feature disabled for you when using Promise::block_until_ready and friends, however.

tokio

If you enable the tokio feature you can use Promise::spawn_async, Promise::spawn_local and Promise::spawn_blocking which will spawn tasks in the surrounding tokio runtime.

Enables tokio

web = wasm-bindgen, wasm-bindgen-futures

If you enable the web feature you can use Promise::spawn_local which will spawn tasks using wasm_bindgen_futures::spawn_local.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

wasm-bindgen web?
wasm-bindgen-futures web?