mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
time: rename tokio::timer -> tokio::time (#1745)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
//! A mocked clock for use with `tokio::timer` based futures.
|
||||
//! A mocked clock for use with `tokio::time` based futures.
|
||||
//!
|
||||
//! # Example
|
||||
//!
|
||||
//! ```
|
||||
//! use tokio::clock;
|
||||
//! use tokio::timer::delay;
|
||||
//! use tokio::time::{clock, delay};
|
||||
//! use tokio_test::{assert_ready, assert_pending, task};
|
||||
//!
|
||||
//! use std::time::Duration;
|
||||
@@ -23,8 +22,8 @@
|
||||
//! ```
|
||||
|
||||
use tokio::runtime::{Park, Unpark};
|
||||
use tokio::timer::clock::{Clock, Now};
|
||||
use tokio::timer::Timer;
|
||||
use tokio::time::clock::{Clock, Now};
|
||||
use tokio::time::Timer;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
@@ -125,13 +124,13 @@ impl MockClock {
|
||||
where
|
||||
F: FnOnce(&mut Handle) -> R,
|
||||
{
|
||||
tokio::timer::clock::with_default(&self.clock, || {
|
||||
tokio::time::clock::with_default(&self.clock, || {
|
||||
let park = self.time.mock_park();
|
||||
let timer = Timer::new(park);
|
||||
let handle = timer.handle();
|
||||
let time = self.time.clone();
|
||||
|
||||
let _timer = tokio::timer::set_default(&handle);
|
||||
let _timer = tokio::time::set_default(&handle);
|
||||
let mut handle = Handle::new(timer, time);
|
||||
f(&mut handle)
|
||||
// lazy(|| Ok::<_, ()>(f(&mut handle))).wait().unwrap()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::sync::mpsc;
|
||||
use tokio::timer::{clock, timer, Delay};
|
||||
use tokio::time::{clock, timer, Delay};
|
||||
|
||||
use bytes::Buf;
|
||||
use futures_core::ready;
|
||||
|
||||
Reference in New Issue
Block a user