Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(screen-linux): don't abort when a session's ICE closes or fails (#134)

Cratgog4cb36b7da5b6
diff --git a/apps/screen-linux/src/main.rs b/apps/screen-linux/src/main.rs
index 5229d5e6..deaf54d4 100644
--- a/apps/screen-linux/src/main.rs
+++ b/apps/screen-linux/src/main.rs
@@ -36,6 +36,8 @@ pub struct Helper {
last_status: Mutex<Option<Value>>,
sessions: Mutex<HashMap<String, stream::Session>>,
out: Outbox,
+ /// GStreamer calls `ended` from its own threads, outside the Tokio runtime.
+ rt: tokio::runtime::Handle,
}
#[tokio::main]
@@ -80,6 +82,7 @@ async fn serve(sock: UnixStream, portal: &Arc<Mutex<Option<portal::Portal>>>) ->
last_status: Mutex::new(None),
sessions: Mutex::default(),
out: out.clone(),
+ rt: tokio::runtime::Handle::current(),
});
helper.send_status().await;
let watched = helper.clone();
@@ -242,7 +245,7 @@ impl Helper {
pub fn ended(self: &Arc<Self>, id: &str) {
let this = self.clone();
let id = id.to_owned();
- tokio::spawn(async move {
+ self.rt.spawn(async move {
if let Some(s) = this.sessions.lock().await.remove(&id) {
s.close();
}