Trait ntp_daemon::spawn::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 Twhere T: BasicSpawner<Error = E> + Send + 'static, E: Error + Send + 'static,

§

type Error = E