You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add a TokioContext future that takes some future F and a "handle" to the runtime (in tokio 0.2 this will be Handle and in tokio 0.3 this will be Runtime). It should then implement the Future trait when F: Future and will wrap each call to poll of the inner future with Handle::enter. This gist has an example implementation called TokioIo.
This should also live behind some feature flag in util, possibly rt-core since that will line up with the features flags in the main crate.
The text was updated successfully, but these errors were encountered:
Another, possible addition here would be to include the ability to take some runtime "handle" and have a method on it that will wrap it and output a future that can be spawned on other executors but still use the tokio context.
We should add a
TokioContext
future that takes some futureF
and a "handle" to the runtime (in tokio 0.2 this will beHandle
and in tokio 0.3 this will beRuntime
). It should then implement theFuture
trait whenF: Future
and will wrap each call to poll of the inner future withHandle::enter
. This gist has an example implementation calledTokioIo
.This should also live behind some feature flag in util, possibly
rt-core
since that will line up with the features flags in the main crate.The text was updated successfully, but these errors were encountered: