mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-23 22:51:07 +01:00
simplify default_tokio_runtime
This commit is contained in:
parent
c008d716c9
commit
26289b8427
@ -45,6 +45,7 @@
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
|
||||
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
|
||||
#[cfg(all(not(target_os = "linux"), feature = "io-uring"))]
|
||||
compile_error!("io_uring is a linux only feature.");
|
||||
@ -78,9 +79,9 @@ pub mod signal {
|
||||
#[cfg(unix)]
|
||||
pub mod unix {
|
||||
//! Unix specific signals (Tokio re-exports).
|
||||
// pub use tokio::signal::unix::*;
|
||||
pub use tokio::signal::unix::*;
|
||||
}
|
||||
// pub use tokio::signal::ctrl_c;
|
||||
pub use tokio::signal::ctrl_c;
|
||||
}
|
||||
|
||||
#[cfg(feature = "net")]
|
||||
|
@ -12,18 +12,9 @@ pub struct Runtime {
|
||||
rt: tokio::runtime::Runtime,
|
||||
}
|
||||
|
||||
#[cfg(feature = "net")]
|
||||
pub(crate) fn default_tokio_runtime() -> io::Result<tokio::runtime::Runtime> {
|
||||
tokio::runtime::Builder::new_current_thread()
|
||||
.enable_io()
|
||||
.enable_time()
|
||||
.build()
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "net"))]
|
||||
pub(crate) fn default_tokio_runtime() -> io::Result<tokio::runtime::Runtime> {
|
||||
tokio::runtime::Builder::new_current_thread()
|
||||
.enable_time()
|
||||
.enable_all()
|
||||
.build()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user