mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
Change a return value of reactor::poll to io::Result. (#40)
* Change a return value of reactor::poll to io::Result.
* Revert "Change a return value of reactor::poll to io::Result."
This reverts commit 281d8c32d4.
* Return a result from reactor::poll.
* Drop a reactor if any error occurs. Fix warnings in tests.
* Update a documentation for reactor::turn.
* Unwrap the last turn() call in tests.
This commit is contained in:
+3
-3
@@ -10,13 +10,13 @@ use tokio::reactor::Reactor;
|
||||
fn works() {
|
||||
let mut r = Reactor::new().unwrap();
|
||||
r.handle().wakeup();
|
||||
r.turn(None);
|
||||
r.turn(None).unwrap();
|
||||
|
||||
let now = Instant::now();
|
||||
let mut n = 0;
|
||||
while now.elapsed() < Duration::from_millis(10) {
|
||||
n += 1;
|
||||
r.turn(Some(Duration::from_millis(10)));
|
||||
r.turn(Some(Duration::from_millis(10))).unwrap();
|
||||
}
|
||||
assert!(n < 5);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ fn wakes() {
|
||||
|
||||
for _ in 0..N {
|
||||
tx.send(()).unwrap();
|
||||
r.turn(None);
|
||||
r.turn(None).unwrap();
|
||||
}
|
||||
t.join().unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user