Spawn the supervisor session task. The task runs for the lifetime of the sandbox process, reconnecting with exponential backoff on failures.
(
endpoint: String,
sandbox_id: String,
ssh_socket_path: std::path::PathBuf,
netns_fd: Option<i32>,
)
| 231 | /// The task runs for the lifetime of the sandbox process, reconnecting with |
| 232 | /// exponential backoff on failures. |
| 233 | pub fn spawn( |
| 234 | endpoint: String, |
| 235 | sandbox_id: String, |
| 236 | ssh_socket_path: std::path::PathBuf, |
| 237 | netns_fd: Option<i32>, |
| 238 | ) -> tokio::task::JoinHandle<()> { |
| 239 | tokio::spawn(run_session_loop( |
| 240 | endpoint, |
| 241 | sandbox_id, |
| 242 | ssh_socket_path, |
| 243 | netns_fd, |
| 244 | )) |
| 245 | } |
| 246 | |
| 247 | async fn run_session_loop( |
| 248 | endpoint: String, |