Converted more of the codebase to async

This commit is contained in:
2023-01-10 00:37:13 +01:00
parent 5b9d24e82f
commit 220c68cd65
13 changed files with 101 additions and 67 deletions

View File

@@ -1,11 +1,13 @@
use async_trait::async_trait;
use serde::{Serialize, Deserialize};
use tracing::{error, debug};
use rumqttc::{Publish, Event, Incoming, EventLoop};
use tokio::sync::watch;
#[async_trait]
pub trait OnMqtt {
fn on_mqtt(&mut self, message: &Publish);
async fn on_mqtt(&mut self, message: &Publish);
}
pub type Receiver = watch::Receiver<Option<Publish>>;