From b6743899468db6304173aca4c7b32d05ea8d92c9 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 03:23:21 +0000 Subject: remake: the switch worker looks when something changed, not every second It read the remake records and its peers' epochs once a second, whatever happened. It now looks when the records change, within a second of a peer saying another epoch than this node's, and when a vote is due; and by itself, once a second, only while something waits on time: a remake of this epoch open or committed, a rejoin, a catch-up, a member on another epoch. What it keeps for a time, an archived document or a remake's content, it wakes for when that is due. --- src/remake/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/remake/mod.rs') diff --git a/src/remake/mod.rs b/src/remake/mod.rs index 90ae436..4847d5c 100644 --- a/src/remake/mod.rs +++ b/src/remake/mod.rs @@ -311,6 +311,10 @@ pub(crate) trait Host: Clone + Send + Sync + 'static { /// Makes the next sync count as initial again. fn reset_initial_sync(&self); + /// Resolves when the remake worker has something to look at that no change of the + /// document tells: a peer said another epoch than this node's. + fn remake_woken(&self) -> impl Future + Send; + /// Store paths touched by each published document change. fn subscribe_changes(&self) -> broadcast::Receiver>; -- cgit v1.3.1