Use unbounded MQTT client channel.

Even with the messages being handled async (tokio::spawn(...)), during
high throughput or a burst of messages, the channel might still fill up
causing messages to be discarded without any error being printed.
This commit is contained in:
Orne Brocaar 2023-11-06 15:20:10 +00:00
parent b6d390b6ad
commit 9ea174910f
2 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ impl<'a> MqttBackend<'a> {
let conn_opts = conn_opts_b.finalize(); let conn_opts = conn_opts_b.finalize();
// get message stream // get message stream
let mut stream = client.get_stream(25); let mut stream = client.get_stream(None);
let b = MqttBackend { let b = MqttBackend {
client, client,

View File

@ -139,7 +139,7 @@ impl<'a> Integration<'a> {
let conn_opts = conn_opts_b.finalize(); let conn_opts = conn_opts_b.finalize();
// get message stream // get message stream
let mut stream = client.get_stream(25); let mut stream = client.get_stream(None);
let i = Integration { let i = Integration {
command_regex: Regex::new(&templates.render( command_regex: Regex::new(&templates.render(
@ -505,7 +505,7 @@ pub mod test {
let conn_opts = mqtt::ConnectOptionsBuilder::new() let conn_opts = mqtt::ConnectOptionsBuilder::new()
.clean_session(true) .clean_session(true)
.finalize(); .finalize();
let mut stream = client.get_stream(10); let mut stream = client.get_stream(None);
client.connect(conn_opts).await.unwrap(); client.connect(conn_opts).await.unwrap();
client client