mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
Swap Handle/Pinned
* Handle -> Remote * Pinned -> Handle All APIs now take a `&Handle` by default and in general can return an immediate `io::Result` instead of an `IoFuture`. This reflects how most usage will likely be done through handles rather than remotes, and also all previous functionality can be recovered with a `oneshot` plus `Remote::spawn`. Closes #15
This commit is contained in:
+1
-2
@@ -4,7 +4,6 @@ extern crate tokio_core;
|
||||
|
||||
use std::time::{Instant, Duration};
|
||||
|
||||
use futures::Future;
|
||||
use tokio_core::reactor::{Core, Timeout};
|
||||
|
||||
macro_rules! t {
|
||||
@@ -19,7 +18,7 @@ fn smoke() {
|
||||
drop(env_logger::init());
|
||||
let mut l = t!(Core::new());
|
||||
let dur = Duration::from_millis(10);
|
||||
let timeout = Timeout::new(dur, &l.handle()).and_then(|t| t);
|
||||
let timeout = t!(Timeout::new(dur, &l.handle()));
|
||||
let start = Instant::now();
|
||||
t!(l.run(timeout));
|
||||
assert!(start.elapsed() >= dur);
|
||||
|
||||
Reference in New Issue
Block a user