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

Method open_relay

crates/openshell-server/src/supervisor_session.rs:236–254  ·  view source on GitHub ↗

Open a relay channel and return a receiver for the supervisor-side stream. Sends `RelayOpen` over the supervisor's gRPC session and returns a oneshot receiver that resolves once the supervisor opens its reverse HTTP CONNECT to `/relay/{channel_id}`. If the session is not currently registered, this method waits up to `session_wait_timeout` for it to appear. A session may be temporarily absent for

(
        &self,
        sandbox_id: &str,
        session_wait_timeout: Duration,
    )

Source from the content-addressed store, hash-verified

234 /// seconds on a slow cluster), while mid-lifetime calls typically just
235 /// need to cover a short reconnect window.
236 pub async fn open_relay(
237 &self,
238 sandbox_id: &str,
239 session_wait_timeout: Duration,
240 ) -> Result<
241 (
242 String,
243 oneshot::Receiver<Result<tokio::io::DuplexStream, Status>>,
244 ),
245 Status,
246 > {
247 self.open_relay_with_target(
248 sandbox_id,
249 relay_open::Target::Ssh(SshRelayTarget {}),
250 String::new(),
251 session_wait_timeout,
252 )
253 .await
254 }
255
256 pub async fn open_relay_with_target(
257 &self,

Calls 1