Trait polkadot_overseer::SubsystemSender
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 'life0: 'async_trait,
Self: 'async_trait;
fn send_message_with_priority<'life0, 'async_trait, P>(
&'life0 mut self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
P: 'async_trait + Priority,
Self: 'async_trait;
fn try_send_message(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>>;
fn try_send_message_with_priority<P>(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>>
where P: Priority;
fn send_messages<'life0, 'async_trait, I>(
&'life0 mut self,
msgs: I,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait,
<I as IntoIterator>::IntoIter: Send,
Self: 'async_trait;
fn send_unbounded_message(&mut self, msg: OutgoingMessage);
}
Expand description
Sender end of a channel to interface with a subsystem.
Required Methods§
fn send_message<'life0, 'async_trait>(
&'life0 mut self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 mut self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send a direct message to some other Subsystem
, routed based on message type.
fn send_message_with_priority<'life0, 'async_trait, P>(
&'life0 mut self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
P: 'async_trait + Priority,
Self: 'async_trait,
fn send_message_with_priority<'life0, 'async_trait, P>(
&'life0 mut self,
msg: OutgoingMessage,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
P: 'async_trait + Priority,
Self: 'async_trait,
Send a direct message with defined priority to some other Subsystem
, routed based on message type.
fn try_send_message(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>>
fn try_send_message( &mut self, msg: OutgoingMessage, ) -> Result<(), TrySendError<OutgoingMessage>>
Tries to send a direct message to some other Subsystem
, routed based on message type.
This method is useful for cases where the message queue is bounded and the message is ok
to be dropped if the queue is full. If the queue is full, this method will return an error.
This method is not async and will not block the current task.
fn try_send_message_with_priority<P>(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>>where
P: Priority,
fn try_send_message_with_priority<P>(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>>where
P: Priority,
Tries to send a direct message with defined priority to some other Subsystem
, routed based on message type.
If the queue is full, this method will return an error.
This method is not async and will not block the current task.
fn send_messages<'life0, 'async_trait, I>(
&'life0 mut self,
msgs: I,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait,
<I as IntoIterator>::IntoIter: Send,
Self: 'async_trait,
fn send_messages<'life0, 'async_trait, I>(
&'life0 mut self,
msgs: I,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
I: IntoIterator<Item = OutgoingMessage> + Send + 'async_trait,
<I as IntoIterator>::IntoIter: Send,
Self: 'async_trait,
Send multiple direct messages to other Subsystem
s, routed based on message type.
fn 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.