Trait orchestra::SubsystemSender
source · pub trait SubsystemSender<OutgoingMessage>: Clone + Send + 'staticwhere
OutgoingMessage: Send,{
// Required methods
fn send_message<'life0, 'async_trait>(
&'life0 mut self,
msg: OutgoingMessage
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_messages<'life0, 'async_trait, I>(
&'life0 mut self,
msgs: I
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait,
I::IntoIter: Send,
Self: 'async_trait,
'life0: 'async_trait;
fn send_unbounded_message(&mut self, msg: OutgoingMessage);
}
Expand description
Sender end of a channel to interface with a subsystem.
Required Methods§
sourcefn send_message<'life0, 'async_trait>(
&'life0 mut self,
msg: OutgoingMessage
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_message<'life0, 'async_trait>( &'life0 mut self, msg: OutgoingMessage ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Send a direct message to some other Subsystem
, routed based on message type.
sourcefn send_messages<'life0, 'async_trait, I>(
&'life0 mut self,
msgs: I
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait,
I::IntoIter: Send,
Self: 'async_trait,
'life0: 'async_trait,
fn send_messages<'life0, 'async_trait, I>( &'life0 mut self, msgs: I ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait, I::IntoIter: Send, Self: 'async_trait, 'life0: 'async_trait,
Send multiple direct messages to other Subsystem
s, routed based on message type.
sourcefn send_unbounded_message(&mut self, msg: OutgoingMessage)
fn send_unbounded_message(&mut self, msg: OutgoingMessage)
Send a message onto the unbounded queue of some other Subsystem
, routed based on message
type.
This function should be used only when there is some other bounding factor on the messages sent with it. Otherwise, it risks a memory leak.