Spawner

Trait Spawner 

Source
pub trait Spawner {
    type Error: Error + Send;

    // Required methods
    fn run<'async_trait>(
        self,
        action_tx: Sender<SpawnEvent>,
        system_notify: Receiver<SystemEvent>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn get_id(&self) -> SpawnerId;
    fn get_addr_description(&self) -> String;
    fn get_description(&self) -> &str;
}

Required Associated Types§

Required Methods§

Source

fn run<'async_trait>( self, action_tx: Sender<SpawnEvent>, system_notify: Receiver<SystemEvent>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Run a spawner

Actions that the system has to execute can be sent through the action_tx channel and event coming in from the system that the spawner should know about will be sent through the system_notify channel.

Source

fn get_id(&self) -> SpawnerId

Returns the id of this spawner

Source

fn get_addr_description(&self) -> String

Get a description of the address that this spawner is connected to

Source

fn get_description(&self) -> &str

Get a description of the type of spawner

Implementors§

Source§

impl<T, E> Spawner for T
where T: BasicSpawner<Error = E> + Send + 'static, E: Error + Send + 'static,

Source§

type Error = E