From 8dff44f2839a2673a5d886b0dd3fd855a265cc5c Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Thu, 17 Jun 2021 17:09:51 -0600 Subject: [PATCH] dump and sub --- patch-db/src/store.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/patch-db/src/store.rs b/patch-db/src/store.rs index 0241e3e..418f2f6 100644 --- a/patch-db/src/store.rs +++ b/patch-db/src/store.rs @@ -220,6 +220,11 @@ impl PatchDb { pub async fn dump(&self) -> Dump { self.store.read().await.dump() } + pub async fn dump_and_sub(&self) -> (Dump, Receiver>) { + let store = self.store.read().await; + let sub = self.subscriber.subscribe(); + (store.dump(), sub) + } pub async fn exists, V: SegList>( &self, ptr: &JsonPointer,