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