mirror of
https://github.com/async-rs/async-std.git
synced 2025-02-23 12:49:44 +00:00
Reset delay to prevent poll after ready
This commit is contained in:
parent
1c843a8124
commit
1fd05a157f
1 changed files with 2 additions and 0 deletions
|
@ -45,6 +45,8 @@ impl<S: Stream> Stream for Throttle<S, S::Item> {
|
||||||
// Sets last to None.
|
// Sets last to None.
|
||||||
*self.as_mut().delay() = Some(Delay::new(self.duration));
|
*self.as_mut().delay() = Some(Delay::new(self.duration));
|
||||||
return Poll::Ready(Some(v));
|
return Poll::Ready(Some(v));
|
||||||
|
} else {
|
||||||
|
*self.as_mut().delay() = None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue