ProcessManager

Trait ProcessManager 

Source
pub trait ProcessManager: Send + Sync {
    // Required methods
    fn spawn<'life0, 'async_trait>(
        &'life0 mut self,
        spec: CommandSpec,
    ) -> Pin<Box<dyn Future<Output = Result<Spawned, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
        id: ProcId,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn wait<'life0, 'async_trait>(
        &'life0 mut self,
        id: ProcId,
        d: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn kill<'life0, 'async_trait>(
        &'life0 mut self,
        id: ProcId,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn spawn<'life0, 'async_trait>( &'life0 mut self, spec: CommandSpec, ) -> Pin<Box<dyn Future<Output = Result<Spawned, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Spawn a new process.

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, id: ProcId, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gracefully shutdown a process.

Source

fn wait<'life0, 'async_trait>( &'life0 mut self, id: ProcId, d: Duration, ) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait for a process to exit.

Source

fn kill<'life0, 'async_trait>( &'life0 mut self, id: ProcId, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Forcefully kill a process.

Implementors§