Downgrade tokio because some crates aren't ready

Problematic crates include
 - actix-codec > ... > actix-web
 - actix-rt > ... > actix-web
 - async-minecraft-ping
 - dbus-tokio
 - h2 > ... > actix-web
 - trust-dns-proto > ... > actix-web
 - trust-dns-resolver > ... > actix-web
This commit is contained in:
Elias Schriefer 2020-11-04 00:09:02 +01:00
parent 2f8ae9a3f8
commit 2cab09d30b
3 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies] [dependencies]
clap = { version = "2.33", features = ["wrap_help", "color"] } clap = { version = "2.33", features = ["wrap_help", "color"] }
toml = "0.5" toml = "0.5"
tokio = { version = "0.3", features = ["full"] } tokio = { version = "0.2", features = ["full"] }
async-minecraft-ping = "0.2" async-minecraft-ping = "0.2"
dbus = { version = "0.9", features = ["futures"] } dbus = { version = "0.9", features = ["futures"] }
dbus-tokio = "0.6" dbus-tokio = "0.6"

View File

@ -8,7 +8,7 @@ edition = "2018"
[dependencies] [dependencies]
actix-web = "3.2" actix-web = "3.2"
toml = "0.5" toml = "0.5"
tokio = { version = "0.3", features = ["full"] } tokio = { version = "0.2", features = ["full"] }
async-minecraft-ping = "0.2" async-minecraft-ping = "0.2"
dbus = { version = "0.9", features = ["futures"] } dbus = { version = "0.9", features = ["futures"] }
dbus-tokio = "0.6" dbus-tokio = "0.6"

View File

@ -19,10 +19,12 @@ fn iface_name(iface: &str) -> String {
DBUS_NAME.to_owned() + "." + iface DBUS_NAME.to_owned() + "." + iface
} }
fn iface_rt() -> Arc<tokio::runtime::Runtime> { // fn iface_rt() -> Arc<tokio::runtime::Runtime> {
fn iface_rt() -> tokio::runtime::Handle {
IFACE_RT_INIT.call_once(|| { IFACE_RT_INIT.call_once(|| {
unsafe { unsafe {
IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new_multi_thread() // IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new_multi_thread()
IFACE_RT = Some(Arc::new(tokio::runtime::Builder::new()
.thread_name("iface-runtime-worker") .thread_name("iface-runtime-worker")
.build() .build()
.unwrap() .unwrap()
@ -31,7 +33,8 @@ fn iface_rt() -> Arc<tokio::runtime::Runtime> {
}); });
unsafe { unsafe {
IFACE_RT.clone().unwrap() // IFACE_RT.clone().unwrap()
IFACE_RT.clone().map(|x| x.handle().clone()).unwrap()
} }
} }