aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 13:37:04 +0100
committertv <tv@krebsco.de>2026-11-01 13:37:04 +0100
commit5f2fdae1ea54b73eeb2352a28c6558b1e344e4e2 (patch)
tree605dc197f553df4572e3b1f1a5992bc8184d2507 /src/remake/mod.rs
parentefbc9899ab92c34db607f26c0e1b676e1e9d1c81 (diff)
remake: copy stale view when writes stop
This ensures that stale reads show every write that was answered.
Diffstat (limited to 'src/remake/mod.rs')
-rw-r--r--src/remake/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/remake/mod.rs b/src/remake/mod.rs
index 04e9d8a..01e1e3e 100644
--- a/src/remake/mod.rs
+++ b/src/remake/mod.rs
@@ -197,6 +197,11 @@ pub(crate) trait Host: Clone + Send + Sync + 'static {
/// ([`Host::switch_epoch`] with `writable` false).
fn accept_writes(&self) -> impl Future<Output = ()> + Send;
+ /// Stops taking writes (until [`Host::accept_writes`], or a swap that takes them)
+ /// and, with `copy`, returns a copy of the document as it is then, in one step: no
+ /// write is acknowledged that the copy lacks.
+ fn refuse_writes(&self, copy: bool) -> impl Future<Output = Option<Document>> + Send;
+
/// Applies a change downloaded from peers (`fetch_change`), then publishes it like
/// a change received by sync.
fn apply_change(