Skip to main content

SpawnerBackend

Trait SpawnerBackend 

Source
pub trait SpawnerBackend: Send + Sync {
    // Required methods
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        config: ProcessConfig,
    ) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stop<'life0, 'life1, 'async_trait>(
        &'life0 self,
        process: &'life1 SpawnedProcess,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_running<'life0, 'life1, 'async_trait>(
        &'life0 self,
        process: &'life1 SpawnedProcess,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn backend_type(&self) -> &'static str;

    // Provided method
    fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()> { ... }
}
Expand description

Trait for process spawning backends.

Required Methods§

Source

fn spawn<'life0, 'async_trait>( &'life0 self, config: ProcessConfig, ) -> Pin<Box<dyn Future<Output = Result<SpawnedProcess>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Spawn a daemon process.

Source

fn stop<'life0, 'life1, 'async_trait>( &'life0 self, process: &'life1 SpawnedProcess, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stop a spawned process.

Source

fn is_running<'life0, 'life1, 'async_trait>( &'life0 self, process: &'life1 SpawnedProcess, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a process is still running.

Source

fn backend_type(&self) -> &'static str

Get the backend type name.

Provided Methods§

Source

fn stop_tracked_child_sync(&self, process: &SpawnedProcess) -> Result<()>

Synchronous bounded stop of a TRACKED direct child, used only by the launch-transaction guard’s Drop for cancellation cleanup where no async runtime work is guaranteed (#1585). Backends that retain child handles override this to stop through the retained handle — never a blind by-PID signal; the default fails honestly.

Implementors§