Rename Sleep to Delay (#270)

This patch renames `Sleep` from tokio-timer and the tokio facade to
`Delay`. Given that the future does not actually put anything to sleep,
the `Delay` name feels more appropriate.

Fixes #263
This commit is contained in:
Carl Lerche
2018-03-30 14:21:48 -07:00
committed by GitHub
parent baa2502ec6
commit ea172537aa
12 changed files with 220 additions and 224 deletions
+4 -4
View File
@@ -3,7 +3,7 @@
//! This module provides a number of types for executing code after a set period
//! of time.
//!
//! * [`Sleep`][Sleep] is a future that does no work and completes at a specific `Instant`
//! * [`Delay`][Delay] is a future that does no work and completes at a specific `Instant`
//! in time.
//!
//! * [`Interval`][Interval] is a stream yielding a value at a fixed period. It
@@ -28,14 +28,14 @@
//!
//! ```
//! use tokio::prelude::*;
//! use tokio::timer::Sleep;
//! use tokio::timer::Delay;
//!
//! use std::time::{Duration, Instant};
//!
//! let when = Instant::now() + Duration::from_millis(100);
//!
//! tokio::run({
//! Sleep::new(when)
//! Delay::new(when)
//! .map_err(|e| panic!("timer failed; err={:?}", e))
//! .and_then(|_| {
//! println!("Hello world!");
@@ -81,5 +81,5 @@ pub use tokio_timer::{
Deadline,
DeadlineError,
Interval,
Sleep,
Delay,
};