mithril_dmq/consumer/server/interface.rs
1use mithril_common::StdResult;
2
3/// Trait for the server side of consuming messages from a DMQ node.
4#[cfg_attr(test, mockall::automock)]
5#[async_trait::async_trait]
6pub trait DmqConsumerServer: Send + Sync {
7 /// Processes the next message received from the DMQ network.
8 async fn process_message(&self) -> StdResult<()>;
9
10 /// Runs the DMQ consumer server.
11 async fn run(&self) -> StdResult<()>;
12}