feat(tvix/store/pathinfosvc): GRPCPathInfoService::from_client

Change-Id: I4a4f6f713dd76bf95f393c094c0eb9b6d15c5436
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8613
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2023-05-22 19:44:49 +03:00 committed by clbot
parent 8d392221c6
commit 7bd9df0133

View file

@ -25,6 +25,17 @@ impl GRPCPathInfoService {
grpc_client,
}
}
/// construct a [GRPCDirectoryService] from a [proto::path_info_service_client::PathInfoServiceClient<Channel>].
/// panics if called outside the context of a tokio runtime.
pub fn from_client(
grpc_client: proto::path_info_service_client::PathInfoServiceClient<Channel>,
) -> Self {
Self {
tokio_handle: tokio::runtime::Handle::current(),
grpc_client,
}
}
}
impl PathInfoService for GRPCPathInfoService {