Initial Tributary handling

This commit is contained in:
Luke Parker
2023-04-20 05:05:17 -04:00
parent 9e1f3fc85c
commit 8041a0d845
9 changed files with 413 additions and 42 deletions

View File

@@ -12,13 +12,14 @@ pub struct Message {
}
#[async_trait::async_trait]
pub trait Processor: 'static + Send + Sync {
pub trait Processor: 'static + Send + Sync + Clone {
async fn send(&mut self, msg: CoordinatorMessage);
async fn recv(&mut self) -> Message;
async fn ack(&mut self, msg: Message);
}
// TODO: Move this to tests
#[derive(Clone)]
pub struct MemProcessor(Arc<RwLock<VecDeque<Message>>>);
impl MemProcessor {
#[allow(clippy::new_without_default)]