diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-14 12:28:07 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-14 12:28:07 +0100 |
commit | 2183518edccadef47cdeaf6476033b52d8832d6e (patch) | |
tree | 8a7d0ce0a622bd512ad6138a90f4bb4604bc38fb /src/table/merkle.rs | |
parent | 83c8467e23c1f531ae233766d5dc7244afe57f08 (diff) | |
download | garage-2183518edccadef47cdeaf6476033b52d8832d6e.tar.gz garage-2183518edccadef47cdeaf6476033b52d8832d6e.zip |
Spawn all background workers in a separate step
Diffstat (limited to 'src/table/merkle.rs')
-rw-r--r-- | src/table/merkle.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/table/merkle.rs b/src/table/merkle.rs index bcf9f9d7..0fe7d2cb 100644 --- a/src/table/merkle.rs +++ b/src/table/merkle.rs @@ -70,17 +70,17 @@ where F: TableSchema + 'static, R: TableReplication + 'static, { - pub(crate) fn launch(background: &BackgroundRunner, data: Arc<TableData<F, R>>) -> Arc<Self> { + pub(crate) fn new(data: Arc<TableData<F, R>>) -> Arc<Self> { let empty_node_hash = blake2sum(&rmp_to_vec_all_named(&MerkleNode::Empty).unwrap()[..]); - let ret = Arc::new(Self { + Arc::new(Self { data, empty_node_hash, - }); - - background.spawn_worker(MerkleWorker(ret.clone())); + }) + } - ret + pub(crate) fn spawn_workers(self: &Arc<Self>, background: &BackgroundRunner) { + background.spawn_worker(MerkleWorker(self.clone())); } fn updater_loop_iter(&self) -> Result<WorkerState, Error> { |