mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-26 17:03:09 +00:00
feat(appd): broadcast AppState::Stopped when supervised process exits
runtime.rs: after the child exits (natural exit or abort), supervise()
now broadcasts AppState { session_id, state: Stopped } in the same
lock scope as set_state. WebSocket clients receive the notification
without needing to poll QueryAppState or call TerminateApp.
This commit is contained in:
parent
68e1f82ca7
commit
3315b158db
1 changed files with 8 additions and 4 deletions
|
|
@ -75,10 +75,14 @@ pub(crate) async fn supervise(
|
|||
}
|
||||
}
|
||||
|
||||
registry
|
||||
.lock()
|
||||
.await
|
||||
.set_state(session_id, AppStateKind::Stopped);
|
||||
{
|
||||
let mut reg = registry.lock().await;
|
||||
reg.set_state(session_id, AppStateKind::Stopped);
|
||||
let _ = reg.broadcast().send(Response::AppState {
|
||||
session_id,
|
||||
state: AppStateKind::Stopped,
|
||||
});
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue