[−][src]Trait futures::compat::Executor01CompatExt
Extension trait for futures 0.1 Executor
.
Required Methods
fn compat(self) -> Executor01As03<Self>
Converts a futures 0.1 Executor
into a
futures 0.3 Spawn
.
ⓘThis example is not tested
#![feature(async_await, await_macro, futures_api)] use futures::Future; use futures::future::{FutureExt, TryFutureExt}; use futures::compat::Executor01CompatExt; use futures::spawn; use tokio_threadpool::ThreadPool; let pool01 = ThreadPool::new(); let future03 = async { println!("Running on the pool"); spawn!(async { println!("Spawned!"); }).unwrap(); }; let future01 = future03.unit_error().boxed().compat(); pool01.spawn(future01); pool01.shutdown_on_idle().wait().unwrap();