diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/config.rs b/src/config.rs index 1190b9a..0f9cff3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -3,7 +3,7 @@ use std::{collections::HashMap, fs, path::Path, process, time::Duration}; -use rumqttc::{Client, Connection, MqttOptions}; +use rumqttc::{AsyncClient, EventLoop, MqttOptions}; use serde::Deserialize; use crate::PROGRAM; @@ -41,7 +41,7 @@ pub struct Config { } impl Config { - pub fn mqtt_client(&self) -> (Client, Connection) { + pub fn mqtt_client(&self) -> (AsyncClient, EventLoop) { let client_id = format!("{}_{}", self.id, process::id()); let mut options = MqttOptions::new(client_id, &self.host, self.port); if let Some(credentials) = &self.credentials { @@ -49,7 +49,7 @@ impl Config { } options.set_keep_alive(Duration::from_secs(5)); options.set_max_packet_size(10 * 1024 * 1024, 10 * 1024 * 1024); - Client::new(options, 10) + AsyncClient::new(options, 10) } } |