feat(managed): add unified Tokio managed task
This commit is contained in:
9 files changed
+1720
-76
No files matched your search
@@ -71,6 +71,16 @@ impl PendingMap {
|
||||
self.map.len()
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub fn next_timeout_deadline(&self) -> Option<Instant> {
|
||||
self.map.values().map(|probe| probe.timeout_at).min()
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub fn latest_timeout_deadline(&self) -> Option<Instant> {
|
||||
self.map.values().map(|probe| probe.timeout_at).max()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn contains(&self, wire_seq: u32) -> bool {
|
||||
self.map.contains_key(&wire_seq)
|
||||
@@ -139,6 +149,11 @@ impl TimedOutMap {
|
||||
self.map.len()
|
||||
}
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
pub fn latest_timeout_deadline(&self) -> Option<Instant> {
|
||||
self.map.values().map(|probe| probe.timeout_at).max()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn contains(&self, wire_seq: u32) -> bool {
|
||||
self.map.contains_key(&wire_seq)
|
||||
|
||||
Reference in new issue
Block a user