From 3e132d2bc67a9ca3a4cda02749ef606df194a70a Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 8 Mar 2022 23:42:52 +0000 Subject: [PATCH] update tokio-uring to 0.3 (#448) --- actix-rt/CHANGES.md | 6 ++++++ actix-rt/Cargo.toml | 4 ++-- actix-rt/README.md | 4 ++-- actix-server/CHANGES.md | 6 ++++++ actix-server/Cargo.toml | 10 +++++----- actix-server/README.md | 4 ++-- actix-server/examples/file-reader.rs | 4 +++- actix-server/examples/tcp-echo.rs | 11 +++++------ 8 files changed, 31 insertions(+), 18 deletions(-) diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 80733537..671b623a 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -1,8 +1,14 @@ # Changes ## Unreleased - 2022-xx-xx + + +## 2.7.0 - 2022-03-08 +- Update `tokio-uring` dependency to `0.3.0`. [#448] - Minimum supported Rust version (MSRV) is now 1.49. +[#448]: https://github.com/actix/actix-net/pull/448 + ## 2.6.0 - 2022-01-12 - Update `tokio-uring` dependency to `0.2.0`. [#436] diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 3925b7b9..10eac079 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-rt" -version = "2.6.0" +version = "2.7.0" authors = [ "Nikolay Kim ", "Rob Ede ", @@ -29,7 +29,7 @@ actix-macros = { version = "0.2.3", optional = true } futures-core = { version = "0.3", default-features = false } tokio = { version = "1.13.1", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] } -# runtime for io-uring feature +# runtime for `io-uring` feature [target.'cfg(target_os = "linux")'.dependencies] tokio-uring = { version = "0.3", optional = true } diff --git a/actix-rt/README.md b/actix-rt/README.md index 5e912032..e598f0b6 100644 --- a/actix-rt/README.md +++ b/actix-rt/README.md @@ -3,11 +3,11 @@ > Tokio-based single-threaded async runtime for the Actix ecosystem. [![crates.io](https://img.shields.io/crates/v/actix-rt?label=latest)](https://crates.io/crates/actix-rt) -[![Documentation](https://docs.rs/actix-rt/badge.svg?version=2.6.0)](https://docs.rs/actix-rt/2.6.0) +[![Documentation](https://docs.rs/actix-rt/badge.svg?version=2.7.0)](https://docs.rs/actix-rt/2.7.0) [![Version](https://img.shields.io/badge/rustc-1.46+-ab6000.svg)](https://blog.rust-lang.org/2020/03/12/Rust-1.46.html) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-rt.svg)
-[![dependency status](https://deps.rs/crate/actix-rt/2.6.0/status.svg)](https://deps.rs/crate/actix-rt/2.6.0) +[![dependency status](https://deps.rs/crate/actix-rt/2.7.0/status.svg)](https://deps.rs/crate/actix-rt/2.7.0) ![Download](https://img.shields.io/crates/d/actix-rt.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/WghFtEH6Hb) diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 90b291c2..c0e7fa40 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -1,9 +1,15 @@ # Changes ## Unreleased - 2022-xx-xx + + +## 2.1.0 - 2022-03-08 +- Update `tokio-uring` dependency to `0.3.0`. [#448] +- Logs emitted now use the `tracing` crate with `log` compatibility. [#448] - Wait for accept thread to stop before sending completion signal. [#443] [#443]: https://github.com/actix/actix-net/pull/443 +[#448]: https://github.com/actix/actix-net/pull/448 ## 2.0.0 - 2022-01-19 diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index bf6a9efa..c165e798 100755 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-server" -version = "2.0.0" +version = "2.1.0" authors = [ "Nikolay Kim ", "fakeshadow <24548779@qq.com>", @@ -24,9 +24,9 @@ default = [] io-uring = ["tokio-uring", "actix-rt/io-uring"] [dependencies] -actix-rt = { version = "2.6.0", default-features = false } -actix-service = "2.0.0" -actix-utils = "3.0.0" +actix-rt = { version = "2.7", default-features = false } +actix-service = "2" +actix-utils = "3" futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] } futures-util = { version = "0.3.7", default-features = false, features = ["alloc"] } @@ -36,7 +36,7 @@ socket2 = "0.4.2" tokio = { version = "1.13.1", features = ["sync"] } tracing = { version = "0.1.30", features = ["log"] } -# runtime for io-uring feature +# runtime for `io-uring` feature [target.'cfg(target_os = "linux")'.dependencies] tokio-uring = { version = "0.3", optional = true } diff --git a/actix-server/README.md b/actix-server/README.md index e4ef95b1..632c194f 100644 --- a/actix-server/README.md +++ b/actix-server/README.md @@ -3,10 +3,10 @@ > General purpose TCP server built for the Actix ecosystem. [![crates.io](https://img.shields.io/crates/v/actix-server?label=latest)](https://crates.io/crates/actix-server) -[![Documentation](https://docs.rs/actix-server/badge.svg?version=2.0.0)](https://docs.rs/actix-server/2.0.0) +[![Documentation](https://docs.rs/actix-server/badge.svg?version=2.1.0)](https://docs.rs/actix-server/2.1.0) [![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html) ![License](https://img.shields.io/crates/l/actix-server.svg) -[![Dependency Status](https://deps.rs/crate/actix-server/2.0.0/status.svg)](https://deps.rs/crate/actix-server/2.0.0) +[![Dependency Status](https://deps.rs/crate/actix-server/2.1.0/status.svg)](https://deps.rs/crate/actix-server/2.1.0) ![Download](https://img.shields.io/crates/d/actix-server.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x) diff --git a/actix-server/examples/file-reader.rs b/actix-server/examples/file-reader.rs index 63f6529a..81b7373a 100644 --- a/actix-server/examples/file-reader.rs +++ b/actix-server/examples/file-reader.rs @@ -39,8 +39,10 @@ async fn run() -> io::Result<()> { // wait for next line match framed.next().await { Some(Ok(line)) => { - match File::open(line).await { + match File::open(&line).await { Ok(mut file) => { + tracing::info!("reading file: {}", &line); + // read file into String buffer let mut buf = String::new(); file.read_to_string(&mut buf).await?; diff --git a/actix-server/examples/tcp-echo.rs b/actix-server/examples/tcp-echo.rs index 0bf819c7..0ae82cc3 100644 --- a/actix-server/examples/tcp-echo.rs +++ b/actix-server/examples/tcp-echo.rs @@ -23,7 +23,6 @@ use actix_service::{fn_service, ServiceFactoryExt as _}; use bytes::BytesMut; use futures_util::future::ok; use tokio::io::{AsyncReadExt as _, AsyncWriteExt as _}; -use tracing::{error, info}; async fn run() -> io::Result<()> { env_logger::init_from_env(env_logger::Env::default().default_filter_or("info")); @@ -31,7 +30,7 @@ async fn run() -> io::Result<()> { let count = Arc::new(AtomicUsize::new(0)); let addr = ("127.0.0.1", 8080); - info!("starting server on port: {}", &addr.0); + tracing::info!("starting server on port: {}", &addr.0); // Bind socket address and start worker(s). By default, the server uses the number of physical // CPU cores as the worker count. For this reason, the closure passed to bind needs to return @@ -58,14 +57,14 @@ async fn run() -> io::Result<()> { // more bytes to process Ok(bytes_read) => { - info!("[{}] read {} bytes", num, bytes_read); + tracing::info!("[{}] read {} bytes", num, bytes_read); stream.write_all(&buf[size..]).await.unwrap(); size += bytes_read; } // stream error; bail from loop with error Err(err) => { - error!("Stream Error: {:?}", err); + tracing::error!("Stream Error: {:?}", err); return Err(()); } } @@ -75,10 +74,10 @@ async fn run() -> io::Result<()> { Ok((buf.freeze(), size)) } }) - .map_err(|err| error!("Service Error: {:?}", err)) + .map_err(|err| tracing::error!("Service Error: {:?}", err)) .and_then(move |(_, size)| { let num = num2.load(Ordering::SeqCst); - info!("[{}] total bytes read: {}", num, size); + tracing::info!("[{}] total bytes read: {}", num, size); ok(size) }) })?