diff options
Diffstat (limited to 'tvix/castore/src')
-rw-r--r-- | tvix/castore/src/blobservice/tests/utils.rs | 3 | ||||
-rw-r--r-- | tvix/castore/src/directoryservice/tests/utils.rs | 3 | ||||
-rw-r--r-- | tvix/castore/src/tonic.rs | 6 |
3 files changed, 9 insertions, 3 deletions
diff --git a/tvix/castore/src/blobservice/tests/utils.rs b/tvix/castore/src/blobservice/tests/utils.rs index 706c4b5e4319..7df4f00d3a09 100644 --- a/tvix/castore/src/blobservice/tests/utils.rs +++ b/tvix/castore/src/blobservice/tests/utils.rs @@ -2,6 +2,7 @@ use crate::blobservice::{BlobService, MemoryBlobService}; use crate::proto::blob_service_client::BlobServiceClient; use crate::proto::GRPCBlobServiceWrapper; use crate::{blobservice::GRPCBlobService, proto::blob_service_server::BlobServiceServer}; +use hyper_util::rt::TokioIo; use tonic::transport::{Endpoint, Server, Uri}; /// Constructs and returns a gRPC BlobService. @@ -33,7 +34,7 @@ pub async fn make_grpc_blob_service_client() -> Box<dyn BlobService> { .unwrap() .connect_with_connector(tower::service_fn(move |_: Uri| { let right = maybe_right.take().unwrap(); - async move { Ok::<_, std::io::Error>(right) } + async move { Ok::<_, std::io::Error>(TokioIo::new(right)) } })) .await .unwrap(), diff --git a/tvix/castore/src/directoryservice/tests/utils.rs b/tvix/castore/src/directoryservice/tests/utils.rs index 0f706695eec8..3d245ea412d5 100644 --- a/tvix/castore/src/directoryservice/tests/utils.rs +++ b/tvix/castore/src/directoryservice/tests/utils.rs @@ -6,6 +6,7 @@ use crate::{ proto::directory_service_server::DirectoryServiceServer, }; +use hyper_util::rt::TokioIo; use tonic::transport::{Endpoint, Server, Uri}; /// Constructs and returns a gRPC DirectoryService. @@ -37,7 +38,7 @@ pub async fn make_grpc_directory_service_client() -> Box<dyn DirectoryService> { .unwrap() .connect_with_connector(tower::service_fn(move |_: Uri| { let right = maybe_right.take().unwrap(); - async move { Ok::<_, std::io::Error>(right) } + async move { Ok::<_, std::io::Error>(TokioIo::new(right)) } })) .await .unwrap(), diff --git a/tvix/castore/src/tonic.rs b/tvix/castore/src/tonic.rs index 4b65d6b028ef..e63e1ad7aab8 100644 --- a/tvix/castore/src/tonic.rs +++ b/tvix/castore/src/tonic.rs @@ -1,3 +1,4 @@ +use hyper_util::rt::TokioIo; use tokio::net::UnixStream; use tonic::transport::{Channel, Endpoint}; @@ -25,7 +26,10 @@ pub async fn channel_from_url(url: &url::Url) -> Result<Channel, self::Error> { let connector = tower::service_fn({ let url = url.clone(); - move |_: tonic::transport::Uri| UnixStream::connect(url.path().to_string().clone()) + move |_: tonic::transport::Uri| { + let unix = UnixStream::connect(url.path().to_string().clone()); + async move { Ok::<_, std::io::Error>(TokioIo::new(unix.await?)) } + } }); // the URL doesn't matter |