Skip to main content

OopBackend

Trait OopBackend 

Source
pub trait OopBackend: Send + Sync {
    // Required methods
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        config: OopSpawnConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A type-erased backend for spawning OoP modules.

This trait is used by HostRuntime to spawn OoP modules after the start phase.

Required Methods§

Source

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

Spawn an OoP module instance.

Source

fn shutdown_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown all spawned instances (called during stop phase).

Implementors§

Source§

impl OopBackend for LocalProcessBackend

Adapter that implements OopBackend trait for LocalProcessBackend.

This allows LocalProcessBackend to be used by HostRuntime for spawning OoP modules.