Skip to main content

running_shells_for_session

Function running_shells_for_session 

Source
pub fn running_shells_for_session(session_id: &str) -> Vec<String>
Expand description

Returns the ids of background shells owned by session_id that are still running (issue #84, phase 2a). Mirrors the sync get_shell/remove_shell helpers over the global registry — not async because the registry is a sync DashMap and status() is a sync read. A shell is included only when its stored session_id equals Some(session_id) and status() is "running", so completed shells and shells belonging to another session (or none) are excluded.

The result is a point-in-time snapshot: a returned shell may finish between this call and the caller acting on its id, so callers must re-check liveness (e.g. via get_shell(id).status()) before treating an id as still running.