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 usePromise::spawn_async
andPromise::spawn_blocking
which will spawn tasks in the surrounding async-std runtime.Enables async-std
- smol
-
If you enable the
smol
feature you can usePromise::spawn_async
andPromise::spawn_local
which will spawn tasks using the smol executor. Remember to tick the smol executor withtick
andtick_local
.Enables smol ^1.2.5
Affects
poll-promise::tick
,poll-promise::tick_local
… - smol_tick_poll
-
Enabling the
smol_tick_poll
feature (together withsmol
) callingPromise::poll
will automatically tick the smol executor. This means you do not have to worry about callingtick
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 withsmol_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 usePromise::spawn_async
,Promise::spawn_local
andPromise::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 usePromise::spawn_local
which will spawn tasks usingwasm_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.