2019-06-30 08:48:53 -07:00
|
|
|
#![cfg(features = "broken")]
|
|
|
|
|
|
2019-02-21 11:56:15 -08:00
|
|
|
extern crate env_logger;
|
2018-02-21 07:42:22 -08:00
|
|
|
extern crate futures;
|
|
|
|
|
extern crate tokio_threadpool;
|
|
|
|
|
|
|
|
|
|
use futures::sync::oneshot;
|
2019-02-21 11:56:15 -08:00
|
|
|
use futures::*;
|
|
|
|
|
use tokio_threadpool::*;
|
2018-02-21 07:42:22 -08:00
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
|
let _ = ::env_logger::init();
|
|
|
|
|
|
|
|
|
|
let pool = ThreadPool::new();
|
|
|
|
|
let tx = pool.sender().clone();
|
|
|
|
|
|
2019-02-21 11:56:15 -08:00
|
|
|
let res = oneshot::spawn(
|
|
|
|
|
future::lazy(|| {
|
|
|
|
|
println!("Running on the pool");
|
|
|
|
|
Ok::<_, ()>("complete")
|
|
|
|
|
}),
|
|
|
|
|
&tx,
|
|
|
|
|
);
|
2018-02-21 07:42:22 -08:00
|
|
|
|
|
|
|
|
println!("Result: {:?}", res.wait());
|
|
|
|
|
}
|