Update documentation in Config about Send futures
Futures are indeed `Send` now!
This commit is contained in:
@@ -379,15 +379,12 @@ impl Config {
|
|||||||
///
|
///
|
||||||
/// To remedy this situation you have a two possible ways to solve this:
|
/// To remedy this situation you have a two possible ways to solve this:
|
||||||
///
|
///
|
||||||
/// * First you can spawn futures into a thread pool. Care must be taken for
|
/// * First you can spawn futures into a thread pool. By doing this in a
|
||||||
/// this because Wasmtime futures are not `Send` or `Sync`. If you ensure
|
/// thread pool you are relaxing the requirement that `Future::poll` must
|
||||||
/// that the entire state of a `Store` is wrapped up in a single future,
|
/// be fast because your future is executing on a separate thread. This
|
||||||
/// though, you can send the whole future at once to a separate thread. By
|
/// strategy, however, would likely still require some form of
|
||||||
/// doing this in a thread pool you are relaxing the requirement that
|
/// cancellation via [`crate::Store::interrupt_handle`] to ensure wasm
|
||||||
/// `Future::poll` must be fast because your future is executing on a
|
/// doesn't take *too* long to execute.
|
||||||
/// separate thread. This strategy, however, would likely still require
|
|
||||||
/// some form of cancellation via [`crate::Store::interrupt_handle`] to ensure
|
|
||||||
/// wasm doesn't take *too* long to execute.
|
|
||||||
///
|
///
|
||||||
/// * Alternatively you can enable the
|
/// * Alternatively you can enable the
|
||||||
/// [`Config::consume_fuel`](crate::Config::consume_fuel) method as well
|
/// [`Config::consume_fuel`](crate::Config::consume_fuel) method as well
|
||||||
@@ -398,8 +395,9 @@ impl Config {
|
|||||||
/// method, and will get automatically re-polled later. This enables the
|
/// method, and will get automatically re-polled later. This enables the
|
||||||
/// `Future::poll` method to take roughly a fixed amount of time since
|
/// `Future::poll` method to take roughly a fixed amount of time since
|
||||||
/// fuel is guaranteed to get consumed while wasm is executing. Note that
|
/// fuel is guaranteed to get consumed while wasm is executing. Note that
|
||||||
/// to prevent infinite execution of wasm you'll still need to use
|
/// to prevent infinite execution of wasm you'll need to use either
|
||||||
/// [`crate::Store::interrupt_handle`].
|
/// [`crate::Store::interrupt_handle`] or a normal timeout on futures
|
||||||
|
/// (which will get triggered due to periodic `poll`s).
|
||||||
///
|
///
|
||||||
/// In either case special care needs to be taken when integrating
|
/// In either case special care needs to be taken when integrating
|
||||||
/// asynchronous wasm into your application. You should carefully plan where
|
/// asynchronous wasm into your application. You should carefully plan where
|
||||||
|
|||||||
Reference in New Issue
Block a user