mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
aquatic_udp: use features "with-glommio" and (default) "with-mio"
This commit is contained in:
parent
f69e3a00c7
commit
13d0224321
3 changed files with 24 additions and 8 deletions
|
|
@ -10,8 +10,9 @@ use cfg_if::cfg_if;
|
|||
|
||||
pub mod common;
|
||||
pub mod config;
|
||||
#[cfg(all(feature = "io_uring", target_os = "linux"))]
|
||||
#[cfg(all(feature = "with-glommio", target_os = "linux"))]
|
||||
pub mod glommio;
|
||||
#[cfg(feature = "with-mio")]
|
||||
pub mod mio;
|
||||
|
||||
use config::Config;
|
||||
|
|
@ -21,7 +22,7 @@ pub const APP_NAME: &str = "aquatic_udp: UDP BitTorrent tracker";
|
|||
|
||||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
cfg_if! {
|
||||
if #[cfg(all(feature = "io_uring", target_os = "linux"))] {
|
||||
if #[cfg(all(feature = "with-glommio", target_os = "linux"))] {
|
||||
glommio::run(config)
|
||||
} else {
|
||||
mio::run(config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue