summaryrefslogtreecommitdiffstats
path: root/src/remake/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 16:18:58 +0200
committertv <tv@krebsco.de>2026-10-24 16:18:58 +0200
commit371e52cb48bae99232547f6fae6a0487a85c2d04 (patch)
treed0222c1f7f727322525fc04772297437fd349f77 /src/remake/mod.rs
parenteb9cc70985a27fe16788a885b854fb514234c43a (diff)
add chunked download and use it during rejoin
Diffstat (limited to 'src/remake/mod.rs')
-rw-r--r--src/remake/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/remake/mod.rs b/src/remake/mod.rs
index 0895931..1c2be36 100644
--- a/src/remake/mod.rs
+++ b/src/remake/mod.rs
@@ -68,6 +68,16 @@ pub(crate) trait Host: Clone + Send + Sync + 'static {
/// alive recently enough, read from `doc`.
fn electorate(&self, doc: &AutoCommit, now_ms: u64) -> Vec<String>;
+ /// Downloads a change from peers on the local epoch, in chunks from several at once,
+ /// checked against its hash.
+ fn fetch_change(
+ &self,
+ hash: automerge::ChangeHash,
+ ) -> impl Future<Output = anyhow::Result<automerge::Change>> + Send;
+
+ /// Starts sync with every peer (e.g. after holding it back).
+ fn request_sync(&self);
+
fn is_node_ready(&self) -> impl Future<Output = bool> + Send;
/// Known (not forgotten) peers.