mithril_dmq/consumer/interface.rs
1use std::fmt::Debug;
2
3use mithril_common::{StdResult, crypto_helper::TryFromBytes, entities::PartyId};
4
5/// Trait for consuming messages from a DMQ node.
6#[cfg_attr(test, mockall::automock)]
7#[async_trait::async_trait]
8pub trait DmqConsumer<M: TryFromBytes + Debug + Send + Sync>: Send + Sync {
9 /// Consume messages from the DMQ node.
10 async fn consume_messages(&self) -> StdResult<Vec<(M, PartyId)>>;
11}