refactor(client): commit probe sends transactionally

This commit is contained in:
Nils Andreas Svee committed 2026-08-04 01:04:42 +07:00
1 parent b5d0b1e52e
commit 9bc2ac90b3
6 files changed
+901 -169

No files matched your search

+17 -4
View File
@@ -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) {