pub struct RabbitMQClient { /* private fields */ }
Implementations§
Source§impl RabbitMQClient
impl RabbitMQClient
pub async fn commence_saga<T: PayloadCommenceSaga + Serialize>( payload: T, ) -> Result<(), RabbitMQError>
Source§impl RabbitMQClient
impl RabbitMQClient
pub async fn publish_event<T: PayloadEvent + Serialize>( payload: T, ) -> Result<(), RabbitMQError>
Source§impl RabbitMQClient
impl RabbitMQClient
pub async fn connect_to_events( &self, ) -> Result<Emitter<EventHandler, MicroserviceEvent>, RabbitMQError>
pub async fn connect_to_saga_commands( &self, ) -> Result<Emitter<CommandHandler, StepCommand>, RabbitMQError>
Source§impl RabbitMQClient
impl RabbitMQClient
pub async fn new( rabbit_uri: &str, microservice: AvailableMicroservices, events: Option<&'static [MicroserviceEvent]>, ) -> Result<Self, RabbitMQError>
pub fn print_init_message(&self)
Sourcepub async fn health_check_with_reconnection(
&self,
timeout: Duration,
) -> Result<(), HealthCheckError>
pub async fn health_check_with_reconnection( &self, timeout: Duration, ) -> Result<(), HealthCheckError>
health_check_with_reconnection tries to reconnect during 60s in the background, the timeout is for the “normal” health_check
Sourcepub async fn health_check(
&self,
timeout: Duration,
) -> Result<(), HealthCheckError>
pub async fn health_check( &self, timeout: Duration, ) -> Result<(), HealthCheckError>
health_check checks the health of the RabbitMQ connection, events channel, and saga channel. timeout is the maximum time to wait for the health check to complete. ie: the channel can be locked
pub async fn current_connection( &self, ) -> Result<&'static RwLock<Connection>, RabbitMQError>
pub async fn reconnect(&self) -> Result<(), RabbitMQError>
pub async fn cleanup(&self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RabbitMQClient
impl !RefUnwindSafe for RabbitMQClient
impl Send for RabbitMQClient
impl Sync for RabbitMQClient
impl Unpin for RabbitMQClient
impl !UnwindSafe for RabbitMQClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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