pub trait AsyncRuntime {
type YieldNowFuture: Future<Output = ()>;
// Required method
fn yield_now(&self) -> Self::YieldNowFuture;
}Expand description
Required Associated Types§
Sourcetype YieldNowFuture: Future<Output = ()>
type YieldNowFuture: Future<Output = ()>
Future type returned by yield_now
Required Methods§
Sourcefn yield_now(&self) -> Self::YieldNowFuture
fn yield_now(&self) -> Self::YieldNowFuture
Yields the execution back to the runtime
If the protocol performs a long computation, it might be better for performance to split it with yield points, so the signle computation does not starve other tasks.
Implementors§
Source§impl AsyncRuntime for TokioRuntime
Available on crate feature runtime-tokio only.
impl AsyncRuntime for TokioRuntime
Available on crate feature
runtime-tokio only.Source§impl AsyncRuntime for UnknownRuntime
impl AsyncRuntime for UnknownRuntime
type YieldNowFuture = YieldNow
Source§impl<M> AsyncRuntime for Runtime<M>
Available on crate feature state-machine only.
impl<M> AsyncRuntime for Runtime<M>
Available on crate feature
state-machine only.