mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 08:34:21 +02:00
tokio 1.0
This commit is contained in:
parent
777785ab76
commit
f2b0589cf6
4 changed files with 312 additions and 502 deletions
807
Cargo.lock
generated
807
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -7,14 +7,15 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
rumqttc = "0.2.0"
|
||||
tokio = "0.2"
|
||||
rumqttc = "0.5.0"
|
||||
tokio = "1.0"
|
||||
dashmap = "3.11"
|
||||
json = "0.12.4"
|
||||
warp = "0.2.5"
|
||||
warp = "0.3.0"
|
||||
dotenv = "0.15.0"
|
||||
ctrlc = { version = "3.1.7", features = ["termination"] }
|
||||
color-eyre = "0.5.7"
|
||||
async-stream = "0.3.0"
|
||||
pin-utils = "0.1.0"
|
||||
hostname = "^0.3"
|
||||
hostname = "^0.3"
|
||||
tokio-stream = "0.1"
|
||||
|
|
@ -12,8 +12,8 @@ use dashmap::DashMap;
|
|||
use pin_utils::pin_mut;
|
||||
use rumqttc::QoS;
|
||||
use std::sync::Arc;
|
||||
use tokio::stream::StreamExt;
|
||||
use tokio::time::Duration;
|
||||
use tokio_stream::StreamExt;
|
||||
use warp::Filter;
|
||||
|
||||
type DeviceStates = Arc<DashMap<Device, DeviceState>>;
|
||||
|
|
@ -38,7 +38,7 @@ async fn main() -> Result<()> {
|
|||
eprintln!("lost mqtt collection: {:#}", e);
|
||||
}
|
||||
eprintln!("reconnecting after 1s");
|
||||
tokio::time::delay_for(Duration::from_secs(1)).await;
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use async_stream::try_stream;
|
||||
use color_eyre::Result;
|
||||
use rumqttc::{AsyncClient, Event, EventLoop, MqttOptions, Packet, Publish, QoS};
|
||||
use tokio::stream::{Stream, StreamExt};
|
||||
use tokio_stream::{Stream, StreamExt};
|
||||
|
||||
pub async fn mqtt_stream(
|
||||
mqtt_options: MqttOptions,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue