summaryrefslogtreecommitdiffstats
path: root/src/backend/consumer/dummy.rs
blob: c441f12f8d89ae6327c087a5fc826ec11427440d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::{
    client::{ClientEvent, ClientHandle},
    consumer::EventConsumer,
    event::Event,
};
use async_trait::async_trait;

#[derive(Default)]
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) {}
}