This is an automated email from the ASF dual-hosted git repository. xuanwo pushed a commit to branch xuanwo/await-tree-split in repository https://gitbox.apache.org/repos/asf/opendal.git
commit f7c994431e136dfec0949b8c15776534fe5b0a17 Author: Xuanwo <[email protected]> AuthorDate: Mon Dec 8 03:01:10 2025 +0800 refactor: Split await tree layer to new crate Signed-off-by: Xuanwo <[email protected]> --- core/Cargo.lock | 11 +++++++- core/Cargo.toml | 15 ++++++++-- core/core/Cargo.toml | 4 --- core/core/src/layers/mod.rs | 5 ---- core/layers/await-tree/Cargo.toml | 32 ++++++++++++++++++++++ .../await_tree.rs => layers/await-tree/src/lib.rs} | 6 ++-- core/src/lib.rs | 2 ++ 7 files changed, 60 insertions(+), 15 deletions(-) diff --git a/core/Cargo.lock b/core/Cargo.lock index 6ed89eba4..1ca2d6f1f 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -5407,6 +5407,7 @@ dependencies = [ "log", "opendal-core", "opendal-layer-async-backtrace", + "opendal-layer-await-tree", "opendal-service-moka", "opendal-service-s3", "opentelemetry", @@ -5454,7 +5455,6 @@ name = "opendal-core" version = "0.55.0" dependencies = [ "anyhow", - "await-tree", "backon", "base64 0.22.1", "bytes", @@ -5585,6 +5585,15 @@ dependencies = [ "opendal-core", ] +[[package]] +name = "opendal-layer-await-tree" +version = "0.55.0" +dependencies = [ + "await-tree", + "futures", + "opendal-core", +] + [[package]] name = "opendal-service-moka" version = "0.55.0" diff --git a/core/Cargo.toml b/core/Cargo.toml index 329ef377d..dbb742d44 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -17,7 +17,17 @@ [workspace] default-members = [".", "core"] -members = [".", "core", "examples/*", "fuzz", "edge/*", "benches/vs_*", "services/*", "layers/*"] +members = [ + ".", + "core", + "examples/*", + "fuzz", + "edge/*", + "benches/vs_*", + "services/*", + "layers/*", + "layers/await-tree", +] [workspace.package] edition = "2024" @@ -53,7 +63,7 @@ executors-tokio = ["opendal-core/executors-tokio"] internal-path-cache = ["opendal-core/internal-path-cache"] internal-tokio-rt = ["opendal-core/internal-tokio-rt"] layers-async-backtrace = ["dep:opendal-layer-async-backtrace"] -layers-await-tree = ["opendal-core/layers-await-tree"] +layers-await-tree = ["dep:opendal-layer-await-tree"] layers-chaos = ["opendal-core/layers-chaos"] layers-dtrace = ["opendal-core/layers-dtrace"] layers-fastmetrics = ["opendal-core/layers-fastmetrics"] @@ -153,6 +163,7 @@ required-features = ["tests"] [dependencies] opendal-core = { path = "core", version = "0.55.0", default-features = false } opendal-layer-async-backtrace = { path = "layers/async-backtrace", version = "0.55.0", optional = true, default-features = false } +opendal-layer-await-tree = { path = "layers/await-tree", version = "0.55.0", optional = true, default-features = false } opendal-service-s3 = { path = "services/s3", version = "0.55.0", optional = true, default-features = false } opendal-service-moka = { path = "services/moka", version = "0.55.0", optional = true, default-features = false } diff --git a/core/core/Cargo.toml b/core/core/Cargo.toml index 768d7f292..4f527755c 100644 --- a/core/core/Cargo.toml +++ b/core/core/Cargo.toml @@ -95,8 +95,6 @@ layers-otel-metrics = ["dep:opentelemetry", "opentelemetry/metrics"] layers-otel-trace = ["dep:opentelemetry", "opentelemetry/trace"] # Enable layers throttle support. layers-throttle = ["dep:governor"] -# Enable layers await-tree support. -layers-await-tree = ["dep:await-tree"] # Enable dtrace support. layers-dtrace = ["dep:probe"] @@ -349,8 +347,6 @@ web-sys = { version = "0.3.77", optional = true, features = [ ] } # Layers -# for layers-await-tree -await-tree = { version = "0.3", optional = true } # for layers-throttle governor = { version = "0.10.1", optional = true, features = ["std"] } # for layers-metrics diff --git a/core/core/src/layers/mod.rs b/core/core/src/layers/mod.rs index d684b50f3..09ae0d760 100644 --- a/core/core/src/layers/mod.rs +++ b/core/core/src/layers/mod.rs @@ -111,11 +111,6 @@ mod throttle; #[cfg(feature = "layers-throttle")] pub use self::throttle::ThrottleLayer; -#[cfg(feature = "layers-await-tree")] -mod await_tree; -#[cfg(feature = "layers-await-tree")] -pub use self::await_tree::AwaitTreeLayer; - #[cfg(all(target_os = "linux", feature = "layers-dtrace"))] mod dtrace; #[cfg(all(target_os = "linux", feature = "layers-dtrace"))] diff --git a/core/layers/await-tree/Cargo.toml b/core/layers/await-tree/Cargo.toml new file mode 100644 index 000000000..bb3bbcb66 --- /dev/null +++ b/core/layers/await-tree/Cargo.toml @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[package] +name = "opendal-layer-await-tree" +version = "0.55.0" +edition = "2024" +license = "Apache-2.0" +repository = "https://github.com/apache/opendal" +description = "Apache OpenDAL await-tree layer" + +[package.metadata.docs.rs] +all-features = true + +[dependencies] +opendal-core = { path = "../../core", version = "0.55.0", default-features = false } +await-tree = "0.3" +futures = "0.3" diff --git a/core/core/src/layers/await_tree.rs b/core/layers/await-tree/src/lib.rs similarity index 98% rename from core/core/src/layers/await_tree.rs rename to core/layers/await-tree/src/lib.rs index b8b7c35fd..b17eec518 100644 --- a/core/core/src/layers/await_tree.rs +++ b/core/layers/await-tree/src/lib.rs @@ -18,8 +18,8 @@ use await_tree::InstrumentAwait; use futures::Future; -use crate::raw::*; -use crate::*; +use opendal_core::raw::*; +use opendal_core::*; /// Add an Instrument await-tree for actor-based applications to the underlying services. /// @@ -32,7 +32,7 @@ use crate::*; /// # Examples /// /// ```no_run -/// # use opendal_core::layers::AwaitTreeLayer; +/// # use opendal_layer_await_tree::AwaitTreeLayer; /// # use opendal_core::services; /// # use opendal_core::Operator; /// # use opendal_core::Result; diff --git a/core/src/lib.rs b/core/src/lib.rs index 8349138de..03900bb05 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -38,4 +38,6 @@ pub mod layers { pub use opendal_core::layers::*; #[cfg(feature = "layers-async-backtrace")] pub use opendal_layer_async_backtrace::*; + #[cfg(feature = "layers-await-tree")] + pub use opendal_layer_await_tree::*; }
