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-stdfeature you can usePromise::spawn_asyncandPromise::spawn_blockingwhich will spawn tasks in the surrounding async-std runtime.Enables async-std
- smol
-
If you enable the
smolfeature you can usePromise::spawn_asyncandPromise::spawn_localwhich will spawn tasks using the smol executor. Remember to tick the smol executor withtickandtick_local.Enables smol ^1.2.5
Affects
poll-promise::tick,poll-promise::tick_local… - smol_tick_poll
-
Enabling the
smol_tick_pollfeature (together withsmol) callingPromise::pollwill automatically tick the smol executor. This means you do not have to worry about callingtickbut comes at the cost of loss of finer control over the executor.Since calling
tick_localwill block the current thread, running multiple local promises at once withsmol_tick_pollenabled may also cause stuttering.poll-promise will automatically tick the smol executor with this feature disabled for you when using
Promise::block_until_readyand friends, however. - tokio
-
If you enable the
tokiofeature you can usePromise::spawn_async,Promise::spawn_localandPromise::spawn_blockingwhich will spawn tasks in the surrounding tokio runtime.Enables tokio
- web = wasm-bindgen, wasm-bindgen-futures
-
If you enable the
webfeature you can usePromise::spawn_localwhich 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.