aboutsummaryrefslogtreecommitdiff
path: root/src/table/table_sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-11 13:47:21 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-11 13:47:21 +0100
commit8d63738cb062e816fc01c6aa2b32936ad31ff65b (patch)
treed69bb200a86788e2d7cde822afb70d54f7e7f448 /src/table/table_sync.rs
parent3214dd52dd144c99353830d7340ea158e262b06f (diff)
downloadgarage-8d63738cb062e816fc01c6aa2b32936ad31ff65b.tar.gz
garage-8d63738cb062e816fc01c6aa2b32936ad31ff65b.zip
Checkpoint: add merkle tree in data table
Diffstat (limited to 'src/table/table_sync.rs')
-rw-r--r--src/table/table_sync.rs28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/table/table_sync.rs b/src/table/table_sync.rs
index c38b6bd5..51f8cd6f 100644
--- a/src/table/table_sync.rs
+++ b/src/table/table_sync.rs
@@ -106,7 +106,7 @@ where
F: TableSchema + 'static,
R: TableReplication + 'static,
{
- pub(crate) async fn launch(table: Arc<Table<F, R>>) -> Arc<Self> {
+ pub(crate) fn launch(table: Arc<Table<F, R>>) -> Arc<Self> {
let todo = SyncTodo { todo: Vec::new() };
let syncer = Arc::new(TableSyncer {
table: table.clone(),
@@ -119,24 +119,16 @@ where
let (busy_tx, busy_rx) = mpsc::unbounded_channel();
let s1 = syncer.clone();
- table
- .system
- .background
- .spawn_worker(
- format!("table sync watcher for {}", table.name),
- move |must_exit: watch::Receiver<bool>| s1.watcher_task(must_exit, busy_rx),
- )
- .await;
+ table.system.background.spawn_worker(
+ format!("table sync watcher for {}", table.name),
+ move |must_exit: watch::Receiver<bool>| s1.watcher_task(must_exit, busy_rx),
+ );
let s2 = syncer.clone();
- table
- .system
- .background
- .spawn_worker(
- format!("table syncer for {}", table.name),
- move |must_exit: watch::Receiver<bool>| s2.syncer_task(must_exit, busy_tx),
- )
- .await;
+ table.system.background.spawn_worker(
+ format!("table syncer for {}", table.name),
+ move |must_exit: watch::Receiver<bool>| s2.syncer_task(must_exit, busy_tx),
+ );
let s3 = syncer.clone();
tokio::spawn(async move {
@@ -630,7 +622,7 @@ where
}
}
if diff_items.len() > 0 {
- self.table.handle_update(&diff_items[..]).await?;
+ self.table.handle_update(&diff_items[..])?;
}
if items_to_send.len() > 0 {
self.send_items(who, items_to_send).await?;