From 37a348b4fae16b2b1c5ec12deaa085a049833d7f Mon Sep 17 00:00:00 2001 From: Connor Brewster Date: Tue, 19 Sep 2023 11:46:41 -0500 Subject: refactor(tvix/store): Asyncify PathInfoService and DirectoryService We've decided to asyncify all of the services to reduce some of the pains going back and for between sync<->async. The end goal will be for all the tvix-store internals to be async and then expose a sync interface for things like tvix eval io. Change-Id: I97c71f8db1d05a38bd8f625df5087d565705d52d Reviewed-on: https://cl.tvl.fyi/c/depot/+/9369 Autosubmit: Connor Brewster Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/store/src/bin/tvix-store.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'tvix/store/src/bin/tvix-store.rs') diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 1be8b00bd9..7761855ccc 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -229,11 +229,9 @@ async fn main() -> Result<(), Box> { // Ask the PathInfoService for the NAR size and sha256 let root_node_copy = root_node.clone(); let path_info_service_clone = path_info_service.clone(); - let (nar_size, nar_sha256) = tokio::task::spawn_blocking(move || { - path_info_service_clone.calculate_nar(&root_node_copy) - }) - .await - .unwrap()?; + let (nar_size, nar_sha256) = path_info_service_clone + .calculate_nar(&root_node_copy) + .await?; // TODO: make a path_to_name helper function? let name = path @@ -265,10 +263,7 @@ async fn main() -> Result<(), Box> { // put into [PathInfoService], and return the PathInfo that we get back // from there (it might contain additional signatures). - let path_info = - tokio::task::spawn_blocking(move || path_info_service.put(path_info)) - .await - .unwrap()?; + let path_info = path_info_service.put(path_info).await?; let node = path_info.node.unwrap().node.unwrap(); -- cgit 1.4.1