From a1982bdbadb9171279ae383b6774e06593b35c3a Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Mon, 4 Jan 2021 02:16:57 +0800 Subject: [PATCH] add actix-rt::task (#245) --- actix-rt/CHANGES.md | 2 ++ actix-rt/Cargo.toml | 2 +- actix-rt/src/lib.rs | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index ec12e569..6b15c6ed 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -1,7 +1,9 @@ # Changes ## Unreleased - 2021-xx-xx +* Add `task` mod with re-export of `tokio::task::{spawn_blocking, yield_now, JoinHandle}` [#245] +[#245]: https://github.com/actix/actix-net/pull/245 ## 2.0.0-beta.1 - 2020-12-28 ### Added diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index 317345d4..be70d374 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -18,4 +18,4 @@ path = "src/lib.rs" [dependencies] actix-macros = "0.1.0" -tokio = { version = "1", features = ["rt", "net", "signal", "sync", "time"] } +tokio = { version = "1", features = ["rt", "net", "parking_lot", "signal", "sync", "time"] } diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index 440fa33c..6ccd588f 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -63,3 +63,8 @@ pub mod time { pub use tokio::time::{sleep, sleep_until, Sleep}; pub use tokio::time::{timeout, Timeout}; } + +/// task management. +pub mod task { + pub use tokio::task::{spawn_blocking, yield_now, JoinHandle}; +}