mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-21 00:00:10 +02:00
timer: Replace Handle::deadline with Handle::timeout (#1074)
Deadline was deprecated a while ago and replaced with Timeout, but the methods on Handle got missed. Fixes #1071
This commit is contained in:
committed by
Carl Lerche
parent
ea282efb2e
commit
219f24cbf1
@@ -1,5 +1,5 @@
|
||||
use timer::Inner;
|
||||
use {Deadline, Delay, Error, Interval};
|
||||
use {Deadline, Delay, Error, Interval, Timeout};
|
||||
|
||||
use tokio_executor::Enter;
|
||||
|
||||
@@ -139,11 +139,17 @@ impl Handle {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a `Deadline` driven by this handle's associated `Timer`.
|
||||
#[doc(hidden)]
|
||||
#[deprecated(since = "0.2.11", note = "use timeout instead")]
|
||||
pub fn deadline<T>(&self, future: T, deadline: Instant) -> Deadline<T> {
|
||||
Deadline::new_with_delay(future, self.delay(deadline))
|
||||
}
|
||||
|
||||
/// Create a `Timeout` driven by this handle's associated `Timer`.
|
||||
pub fn timeout<T>(&self, value: T, deadline: Instant) -> Timeout<T> {
|
||||
Timeout::new_with_delay(value, self.delay(deadline))
|
||||
}
|
||||
|
||||
/// Create a new `Interval` that starts at `at` and yields every `duration`
|
||||
/// interval after that.
|
||||
pub fn interval(&self, at: Instant, duration: Duration) -> Interval {
|
||||
|
||||
Reference in New Issue
Block a user