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§
sourcefn 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 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.
sourcefn get_addr_description(&self) -> String
fn get_addr_description(&self) -> String
Get a description of the address that this spawner is connected to
sourcefn get_description(&self) -> &str
fn get_description(&self) -> &str
Get a description of the type of spawner