mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
aquatic_udp: feature-gate glommio version
This commit is contained in:
parent
047d138b2b
commit
81b7777a4a
3 changed files with 16 additions and 4 deletions
|
|
@ -14,11 +14,15 @@ path = "src/lib/lib.rs"
|
|||
[[bin]]
|
||||
name = "aquatic_udp"
|
||||
|
||||
[features]
|
||||
with-glommio = ["glommio", "futures-lite"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
aquatic_cli_helpers = "0.1.0"
|
||||
aquatic_common = "0.1.0"
|
||||
aquatic_udp_protocol = "0.1.0"
|
||||
cfg-if = "1"
|
||||
crossbeam-channel = "0.5"
|
||||
hashbrown = "0.11.2"
|
||||
hex = "0.4"
|
||||
|
|
@ -33,8 +37,8 @@ rand = { version = "0.8", features = ["small_rng"] }
|
|||
serde = { version = "1", features = ["derive"] }
|
||||
socket2 = { version = "0.4.1", features = ["all"] }
|
||||
|
||||
glommio = { git = "https://github.com/DataDog/glommio.git" }
|
||||
futures-lite = "1"
|
||||
glommio = { git = "https://github.com/DataDog/glommio.git", rev = "4e6b14772da2f4325271fbcf12d24cf91ed466e5", optional = true }
|
||||
futures-lite = { version = "1", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "1.0"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use aquatic_common::access_list::{AccessListArcSwap, AccessListMode, AccessListQ
|
|||
|
||||
pub mod common;
|
||||
pub mod config;
|
||||
#[cfg(all(feature = "with-glommio", target_os = "linux"))]
|
||||
pub mod glommio;
|
||||
pub mod mio;
|
||||
|
||||
|
|
@ -12,7 +13,13 @@ use config::Config;
|
|||
pub const APP_NAME: &str = "aquatic_udp: UDP BitTorrent tracker";
|
||||
|
||||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
glommio::run(config)
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(all(feature = "with-glommio", target_os = "linux"))] {
|
||||
glommio::run(config)
|
||||
} else {
|
||||
mio::run(config)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_access_list(config: &Config, access_list: &Arc<AccessListArcSwap>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue