MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / connect_compute_driver

Function connect_compute_driver

crates/openshell-server/src/compute/vm.rs:569–584  ·  view source on GitHub ↗
(socket_path: &Path)

Source from the content-addressed store, hash-verified

567
568#[cfg(unix)]
569async fn connect_compute_driver(socket_path: &Path) -> Result<Channel> {
570 let socket_path = socket_path.to_path_buf();
571 let display_path = socket_path.clone();
572 Endpoint::from_static("http://[::]:50051")
573 .connect_with_connector(service_fn(move |_: tonic::transport::Uri| {
574 let socket_path = socket_path.clone();
575 async move { UnixStream::connect(socket_path).await.map(TokioIo::new) }
576 }))
577 .await
578 .map_err(|e| {
579 Error::execution(format!(
580 "failed to connect to vm compute driver socket '{}': {e}",
581 display_path.display()
582 ))
583 })
584}
585
586#[cfg(all(test, unix))]
587mod tests {

Callers 1

wait_for_compute_driverFunction · 0.85

Calls 1

connectFunction · 0.85

Tested by

no test coverage detected