bump tokio to 1.4

This commit is contained in:
fakeshadow 2021-04-18 00:25:51 +08:00
parent c8c041cef1
commit c6568e804d
3 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ log = "0.4"
mio = { version = "0.7.6", features = ["os-poll", "net"] }
num_cpus = "1.13"
slab = "0.4"
tokio = { version = "1.2", features = ["sync"] }
tokio = { version = "1.4", features = ["sync"] }
[dev-dependencies]
actix-codec = "0.4.0-beta.1"

View File

@ -75,7 +75,7 @@ impl Server {
// construct signals future.
let signals = if !builder.no_signals {
// Check tokio runtime.
if tokio::runtime::Handle::try_current().is_err() {
if !is_tokio {
let err = io::Error::new(io::ErrorKind::Other, "there is no reactor running. Please enable ServerBuilder::disable_signals when start server in non tokio 1.x runtime.");
return Self::Error(Some(err));
}

View File

@ -224,6 +224,7 @@ impl ServerWorker {
.unwrap_or_else(|| Ok(handle_pair(idx, tx1, tx2, avail)))
}
// TODO: Use start_non_blocking when restarting worker.
#[allow(dead_code)]
/// Start server worker in async.
pub(crate) fn start_non_blocking(