implements PLN-0058
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good

This commit is contained in:
2026-05-15 06:55:26 +01:00
parent bfe900797f
commit 4d2ea6400d
19 changed files with 499 additions and 281 deletions
@@ -0,0 +1,44 @@
use crate::os::SystemOS;
use crate::task::TaskId;
pub struct SessionsFacade<'a> {
pub(in crate::os) os: &'a mut SystemOS,
}
impl<'a> SessionsFacade<'a> {
pub fn create_vm_game_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.os.process_manager.spawn_vm_game(app_id, title.clone());
let task_id = self.os.task_manager.create_game_task(process_id, app_id, title);
self.os
.lifecycle()
.set_foreground_task(task_id)
.expect("newly created game task should have an associated process");
task_id
}
pub fn create_vm_shell_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.os.process_manager.spawn_vm_shell(app_id, title.clone());
let task_id = self.os.task_manager.create_shell_task(process_id, app_id, title);
self.os
.lifecycle()
.set_foreground_task(task_id)
.expect("newly created shell task should have an associated process");
task_id
}
pub fn create_native_shell_task(&mut self, app_id: u32, title: impl Into<String>) -> TaskId {
let title = title.into();
let process_id = self.os.process_manager.spawn_native_shell(app_id, title.clone());
let task_id = self.os.task_manager.create_shell_task(process_id, app_id, title);
self.os
.lifecycle()
.set_foreground_task(task_id)
.expect("newly created native shell task should have an associated process");
task_id
}
}