pub struct BackgroundTaskManager { /* private fields */ }Implementations§
Source§impl BackgroundTaskManager
impl BackgroundTaskManager
Sourcepub async fn spawn(&mut self, id: String, cmd: &str) -> Result<()>
pub async fn spawn(&mut self, id: String, cmd: &str) -> Result<()>
Spawn a shell command as a background task with the given ID. stdout is piped for AEGIS_PROGRESS parsing.
Sourcepub fn status(&self, id: &str) -> &'static str
pub fn status(&self, id: &str) -> &'static str
Returns “running” if the task exists, “not_found” otherwise.
Sourcepub async fn cancel(&mut self, id: &str)
pub async fn cancel(&mut self, id: &str)
Cancel a task by sending kill signal (tokio sends SIGKILL). Note: tokio’s Child::kill() sends SIGKILL on Unix. For graceful shutdown, callers should use a 5-second timeout then call this method. A future improvement would use nix::sys::signal to send SIGTERM first.
Trait Implementations§
Source§impl Default for BackgroundTaskManager
impl Default for BackgroundTaskManager
Source§impl Drop for BackgroundTaskManager
impl Drop for BackgroundTaskManager
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundTaskManager
impl !UnwindSafe for BackgroundTaskManager
impl Freeze for BackgroundTaskManager
impl Send for BackgroundTaskManager
impl Sync for BackgroundTaskManager
impl Unpin for BackgroundTaskManager
impl UnsafeUnpin for BackgroundTaskManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more