mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
timer: fix Handle::timeout (#1093)
The old implementation didn't work for Timeout<Stream>, since the method took a deadline rather than a timeout.
This commit is contained in:
committed by
Carl Lerche
parent
d4803bc868
commit
b62d224fac
@@ -43,8 +43,12 @@ impl Delay {
|
||||
Delay { registration }
|
||||
}
|
||||
|
||||
pub(crate) fn new_with_handle(deadline: Instant, handle: HandlePriv) -> Delay {
|
||||
let mut registration = Registration::new(deadline, Duration::from_millis(0));
|
||||
pub(crate) fn new_with_handle(
|
||||
deadline: Instant,
|
||||
duration: Duration,
|
||||
handle: HandlePriv,
|
||||
) -> Delay {
|
||||
let mut registration = Registration::new(deadline, duration);
|
||||
registration.register_with(handle);
|
||||
|
||||
Delay { registration }
|
||||
|
||||
Reference in New Issue
Block a user