refactor(client): commit probe sends transactionally
This commit is contained in:
6 files changed
+901
-169
No files matched your search
@@ -72,13 +72,13 @@ impl PendingMap {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn capacity(&self) -> usize {
|
||||
self.map.capacity()
|
||||
pub fn contains(&self, wire_seq: u32) -> bool {
|
||||
self.map.contains_key(&wire_seq)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn contains(&self, wire_seq: u32) -> bool {
|
||||
self.map.contains_key(&wire_seq)
|
||||
pub fn capacity(&self) -> usize {
|
||||
self.map.capacity()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +139,11 @@ impl TimedOutMap {
|
||||
self.map.len()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub fn contains(&self, wire_seq: u32) -> bool {
|
||||
self.map.contains_key(&wire_seq)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn insertion_order_len(&self) -> usize {
|
||||
self.insertion_order.len()
|
||||
@@ -186,6 +191,14 @@ impl CompletedSet {
|
||||
self.set.contains(&seq)
|
||||
}
|
||||
|
||||
pub fn remove(&mut self, seq: u32) -> bool {
|
||||
let removed = self.set.remove(&seq);
|
||||
if removed {
|
||||
self.insertion_order.retain(|entry| *entry != seq);
|
||||
}
|
||||
removed
|
||||
}
|
||||
|
||||
fn evict_oldest(&mut self) {
|
||||
while let Some(oldest_seq) = self.insertion_order.pop_front() {
|
||||
if self.set.remove(&oldest_seq) {
|
||||
|
||||
Reference in new issue
Block a user