mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-27 01:13:09 +00:00
feat(appd): include app_id in AppReady broadcast
ipc.rs: AppReady { session_id, app_id: String }.
runtime.rs: supervise() passes app_id (already in scope as parameter)
when building the AppReady broadcast message.
main.rs: supervisor integration test updated to use .. to ignore
app_id in the AppReady pattern match.
This commit is contained in:
parent
35db7c2ccc
commit
dbe44bd0e0
3 changed files with 6 additions and 6 deletions
|
|
@ -25,6 +25,7 @@ pub enum Response {
|
||||||
},
|
},
|
||||||
AppReady {
|
AppReady {
|
||||||
session_id: u64,
|
session_id: u64,
|
||||||
|
app_id: String,
|
||||||
},
|
},
|
||||||
RunningApps {
|
RunningApps {
|
||||||
sessions: Vec<SessionInfo>,
|
sessions: Vec<SessionInfo>,
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ mod tests {
|
||||||
let notification = rx.try_recv();
|
let notification = rx.try_recv();
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
notification,
|
notification,
|
||||||
Ok(Response::AppReady { session_id: sid }) if sid == session_id
|
Ok(Response::AppReady { session_id: sid, .. }) if sid == session_id
|
||||||
));
|
));
|
||||||
|
|
||||||
let _ = std::fs::remove_file(&script);
|
let _ = std::fs::remove_file(&script);
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,10 @@ pub(crate) async fn supervise(
|
||||||
.lock()
|
.lock()
|
||||||
.await
|
.await
|
||||||
.set_state(session_id, AppStateKind::Running);
|
.set_state(session_id, AppStateKind::Running);
|
||||||
let _ = registry
|
let _ = registry.lock().await.broadcast().send(Response::AppReady {
|
||||||
.lock()
|
session_id,
|
||||||
.await
|
app_id: app_id.to_owned(),
|
||||||
.broadcast()
|
});
|
||||||
.send(Response::AppReady { session_id });
|
|
||||||
tracing::info!(session_id, %app_id, "app ready");
|
tracing::info!(session_id, %app_id, "app ready");
|
||||||
}
|
}
|
||||||
Ok(Err(e)) => {
|
Ok(Err(e)) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue