Add a dummy backend

This commit is contained in:
Ferdinand Schober
2023-12-17 19:06:27 +01:00
committed by Ferdinand Schober
parent eca367cdb4
commit f5a0ff4f3a
11 changed files with 163 additions and 183 deletions

View File

@@ -0,0 +1,21 @@
use async_trait::async_trait;
use crate::{consumer::EventConsumer, event::Event, client::{ClientHandle, ClientEvent}};
pub struct DummyConsumer;
impl DummyConsumer {
pub fn new() -> Self {
Self {}
}
}
#[async_trait]
impl EventConsumer for DummyConsumer {
async fn consume(&mut self, event: Event, client_handle: ClientHandle) {
log::info!("received event: ({client_handle}) {event}");
}
async fn notify(&mut self, client_event: ClientEvent) {
log::info!("{client_event:?}");
}
async fn destroy(&mut self) {}
}