INNER CODE UNIT · Rust

session_handle

EricLBuehler/mistral.rs · mistralrs-code-exec/src/lib.rs:213

    async fn session_handle(
        &self,
        sessions: &Mutex<HashMap<String, Arc<Mutex<PythonSession>>>>,
        session_id: &str,
    ) -> anyhow::Result<Arc<Mutex<PythonSession>>> {
        let mut map = sessions.lock().await;
        if let Some(existing) = map.get(session_id) {
            return Ok(Arc::clone(existing));
        }
        let session = PythonSession::new(
            &self.python_path,
            &self.executor_script,
            self.timeout,
            self.working_directory.as_deref(),
            Arc::clone(&self.sandbox),
            self.sandbox_policy.clone(),
        )
        .await?;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…