diff --git a/Cargo.toml b/Cargo.toml index 80fd782b..8c179d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ ] [workspace.package] -version = "0.6.10" +version = "0.6.14" edition = "2021" authors = ["zhangzicheng@apache.org"] repository = "https://github.com/acl-dev/open-coroutine" @@ -16,9 +16,9 @@ license = "Apache-2.0" readme = "README.md" [workspace.dependencies] -open-coroutine-core = { path = "core", version = "0.6.0" } -open-coroutine-hook = { path = "hook", version = "0.6.0" } -open-coroutine-macros = { path = "macros", version = "0.6.0" } +open-coroutine-core = { path = "core", version = "0.6.14" } +open-coroutine-hook = { path = "hook", version = "0.6.14" } +open-coroutine-macros = { path = "macros", version = "0.6.14" } tracing = { version = "0.1", default-features = false } tracing-subscriber = { version = "0.3", default-features = false } diff --git a/README.md b/README.md index b3b0004c..02db89f6 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,6 @@ fn main() { ## ⚓ Learn More +- [Coroutine Design](core/docs/en/coroutine.md) + [我有故事,你有酒吗?](https://github.com/acl-dev/open-coroutine-docs) diff --git a/docs/en/coroutine.md b/core/docs/en/coroutine.md similarity index 100% rename from docs/en/coroutine.md rename to core/docs/en/coroutine.md diff --git a/core/src/lib.rs b/core/src/lib.rs index c4951636..bbbafcbf 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -60,7 +60,7 @@ pub mod common; #[allow(missing_docs)] pub mod config; -#[doc = include_str!("../../docs/en/coroutine.md")] +#[doc = include_str!("../docs/en/coroutine.md")] pub mod coroutine; /// Make the coroutine automatically yield. diff --git a/open-coroutine/src/lib.rs b/open-coroutine/src/lib.rs index 91ec2c16..617a87e4 100644 --- a/open-coroutine/src/lib.rs +++ b/open-coroutine/src/lib.rs @@ -49,6 +49,7 @@ use open_coroutine_core::co_pool::task::UserTaskFunc; use open_coroutine_core::common::constants::SLICE; +pub use open_coroutine_core::common::ordered_work_steal::DEFAULT_PRECEDENCE; pub use open_coroutine_core::config::Config; use open_coroutine_core::net::UserFunc; pub use open_coroutine_macros::*; @@ -109,19 +110,15 @@ pub fn shutdown() { #[macro_export] macro_rules! task { ( $f: expr , $param:expr , $priority: expr $(,)? ) => { - $crate::task($f, $param, $priority) + $crate::crate_task($f, $param, $priority) }; ( $f: expr , $param:expr $(,)? ) => { - $crate::task( - $f, - $param, - open_coroutine_core::common::ordered_work_steal::DEFAULT_PRECEDENCE, - ) + $crate::crate_task($f, $param, $crate::DEFAULT_PRECEDENCE) }; } /// Create a task. -pub fn task R>( +pub fn crate_task R>( f: F, param: P, priority: c_longlong,