pub struct DefaultCommunicationBus { /* private fields */ }Expand description
Default implementation of the communication bus
Implementations§
Source§impl DefaultCommunicationBus
impl DefaultCommunicationBus
Sourcepub async fn new(
config: CommunicationConfig,
) -> Result<Self, CommunicationError>
pub async fn new( config: CommunicationConfig, ) -> Result<Self, CommunicationError>
Create a new communication bus
Trait Implementations§
Source§impl CommunicationBus for DefaultCommunicationBus
impl CommunicationBus for DefaultCommunicationBus
Source§fn send_message<'life0, 'async_trait>(
&'life0 self,
message: SecureMessage,
) -> Pin<Box<dyn Future<Output = Result<MessageId, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 self,
message: SecureMessage,
) -> Pin<Box<dyn Future<Output = Result<MessageId, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a message to an agent
Source§fn receive_messages<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecureMessage>, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_messages<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecureMessage>, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive messages for an agent
Source§fn subscribe<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
topic: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
topic: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to a topic
Source§fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
topic: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
topic: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unsubscribe from a topic
Source§fn publish<'life0, 'async_trait>(
&'life0 self,
topic: String,
message: SecureMessage,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
topic: String,
message: SecureMessage,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish a message to a topic
Source§fn get_delivery_status<'life0, 'async_trait>(
&'life0 self,
message_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<DeliveryStatus, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_delivery_status<'life0, 'async_trait>(
&'life0 self,
message_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<DeliveryStatus, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get message delivery status
Source§fn register_agent<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_agent<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register an agent for communication
Source§fn unregister_agent<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unregister_agent<'life0, 'async_trait>(
&'life0 self,
agent_id: AgentId,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unregister an agent
Source§fn request<'life0, 'async_trait>(
&'life0 self,
target_agent: AgentId,
request_payload: Bytes,
timeout_duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<Bytes, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn request<'life0, 'async_trait>(
&'life0 self,
target_agent: AgentId,
request_payload: Bytes,
timeout_duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<Bytes, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a request and wait for response with timeout
Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shutdown the communication bus
Source§fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ComponentHealth, CommunicationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check the health of the communication bus
Auto Trait Implementations§
impl Freeze for DefaultCommunicationBus
impl !RefUnwindSafe for DefaultCommunicationBus
impl Send for DefaultCommunicationBus
impl Sync for DefaultCommunicationBus
impl Unpin for DefaultCommunicationBus
impl !UnwindSafe for DefaultCommunicationBus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more