diff options
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/mod.rs | 19 | ||||
| -rw-r--r-- | src/state/session.rs | 2 |
2 files changed, 1 insertions, 20 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs index 673bd56..8ac1124 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -394,25 +394,6 @@ impl AppState { .expect("document read task panicked") } - /// Mutates the document on the blocking pool. - pub(crate) async fn write_doc<T>( - &self, - f: impl FnOnce(&mut Document) -> T + Send + 'static, - ) -> T - where - T: Send + 'static, - { - let doc = Arc::clone(&self.doc); - tokio::task::spawn_blocking(move || { - let mut replica = doc.blocking_write(); - let out = f(&mut replica.doc); - replica.refresh_heads(); - out - }) - .await - .expect("document write task panicked") - } - /// Mutates the document on the blocking pool as one change, then /// publishes it. Write and notification run in the same blocking task, so a /// cancelled request can't leave a committed write unannounced. diff --git a/src/state/session.rs b/src/state/session.rs index bf5c83f..7305c58 100644 --- a/src/state/session.rs +++ b/src/state/session.rs @@ -245,7 +245,7 @@ impl SyncSession { /// For the simulator's dump: the peer's heads as Automerge knows them, and whether /// it thinks a message is in flight. #[cfg(test)] - pub(crate) fn automerge_view(&self) -> (Option<&[crate::document::ChangeHash]>, bool) { + pub(crate) fn sync_view(&self) -> (Option<&[crate::document::ChangeHash]>, bool) { (self.state.their_heads.as_deref(), self.state.in_flight) } |
