diff --git a/Cargo.lock b/Cargo.lock index 3e99c20e..c8942e48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3613,7 +3613,6 @@ dependencies = [ "opentelemetry-http", "opentelemetry-semantic-conventions", "pin-project-lite", - "tokio", "tower", "tracing", "tracing-opentelemetry", diff --git a/Cargo.toml b/Cargo.toml index ca230b6f..1c3ef041 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -157,6 +157,11 @@ features = ["runtime-tokio-rustls", "postgres", "migrate", "chrono", "json", "uu [workspace.dependencies.thiserror] version = "1.0.60" +# Async runtime +[workspace.dependencies.tokio] +version = "1.37.0" +features = ["full"] + # Tower services [workspace.dependencies.tower] version = "0.4.13" diff --git a/crates/axum-utils/Cargo.toml b/crates/axum-utils/Cargo.toml index 36803165..ea7aff7b 100644 --- a/crates/axum-utils/Cargo.toml +++ b/crates/axum-utils/Cargo.toml @@ -30,7 +30,7 @@ serde_with = "3.8.1" serde_urlencoded = "0.7.1" serde_json.workspace = true thiserror.workspace = true -tokio = "1.37.0" +tokio.workspace = true tower.workspace = true tracing.workspace = true url.workspace = true diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 61d1de90..67fc0cf6 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -31,7 +31,7 @@ rustls.workspace = true serde_json.workspace = true serde_yaml = "0.9.34" sqlx.workspace = true -tokio = { version = "1.37.0", features = ["full"] } +tokio.workspace = true tower.workspace = true tower-http = { version = "0.4.4", features = ["fs"] } url.workspace = true diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index 13e922e8..4855079c 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -12,7 +12,7 @@ publish = false workspace = true [dependencies] -tokio = { version = "1.37.0", features = ["fs", "rt"] } +tokio.workspace = true tracing.workspace = true thiserror.workspace = true diff --git a/crates/graphql/Cargo.toml b/crates/graphql/Cargo.toml index bba479c2..f30b8e2a 100644 --- a/crates/graphql/Cargo.toml +++ b/crates/graphql/Cargo.toml @@ -19,7 +19,7 @@ chrono.workspace = true lettre.workspace = true serde.workspace = true thiserror.workspace = true -tokio = { version = "1.37.0", features = ["sync"] } +tokio.workspace = true tracing.workspace = true tower.workspace = true ulid.workspace = true diff --git a/crates/handlers/Cargo.toml b/crates/handlers/Cargo.toml index 1aa26da8..fd7e9a0d 100644 --- a/crates/handlers/Cargo.toml +++ b/crates/handlers/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] # Async runtime -tokio = { version = "1.37.0", features = ["macros"] } +tokio.workspace = true futures-util = "0.3.30" # Logging and tracing diff --git a/crates/http/Cargo.toml b/crates/http/Cargo.toml index 8693731f..6d3c7dfa 100644 --- a/crates/http/Cargo.toml +++ b/crates/http/Cargo.toml @@ -36,7 +36,7 @@ mas-tower = { workspace = true, optional = true } [dev-dependencies] anyhow.workspace = true -tokio = { version = "1.37.0", features = ["macros", "rt"] } +tokio.workspace = true [features] client = [ diff --git a/crates/iana-codegen/Cargo.toml b/crates/iana-codegen/Cargo.toml index 54ae1d87..8b2fdab2 100644 --- a/crates/iana-codegen/Cargo.toml +++ b/crates/iana-codegen/Cargo.toml @@ -20,6 +20,6 @@ csv = "1.3.0" futures-util = "0.3.30" hyper.workspace = true serde.workspace = true -tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread", "fs", "io-util"] } +tokio.workspace= true tracing.workspace = true tracing-subscriber.workspace = true diff --git a/crates/listener/Cargo.toml b/crates/listener/Cargo.toml index 0a117356..1f72c3af 100644 --- a/crates/listener/Cargo.toml +++ b/crates/listener/Cargo.toml @@ -21,7 +21,7 @@ libc = "0.2.154" pin-project-lite = "0.2.14" socket2 = "0.5.7" thiserror.workspace = true -tokio = { version = "1.37.0", features = ["net", "rt", "macros", "signal", "time"] } +tokio.workspace = true tokio-rustls = "0.25.0" tower-http = { version = "0.4.4", features = ["add-extension"] } tower-service = "0.3.2" @@ -30,7 +30,7 @@ tracing.workspace = true [dev-dependencies] anyhow.workspace = true rustls-pemfile = "2.1.2" -tokio = { version = "1.37.0", features = ["net", "rt", "macros", "signal", "time", "rt-multi-thread"] } +tokio.workspace = true tokio-test = "0.4.4" tracing-subscriber.workspace = true diff --git a/crates/matrix/Cargo.toml b/crates/matrix/Cargo.toml index 0055e1de..90582730 100644 --- a/crates/matrix/Cargo.toml +++ b/crates/matrix/Cargo.toml @@ -16,5 +16,5 @@ anyhow.workspace = true serde.workspace = true async-trait.workspace = true http.workspace = true -tokio = { version = "1.37.0", features = ["sync", "macros", "rt"] } +tokio.workspace = true url.workspace = true diff --git a/crates/oidc-client/Cargo.toml b/crates/oidc-client/Cargo.toml index f8206030..f537f177 100644 --- a/crates/oidc-client/Cargo.toml +++ b/crates/oidc-client/Cargo.toml @@ -67,5 +67,5 @@ assert_matches = "1.5.0" bitflags = "2.5.0" mas-keystore.workspace = true rand_chacha = "0.3.1" -tokio = { version = "1.37.0", features = ["rt", "macros", "rt-multi-thread"] } +tokio.workspace = true wiremock = "0.6.0" diff --git a/crates/policy/Cargo.toml b/crates/policy/Cargo.toml index c7a887cd..360e6c77 100644 --- a/crates/policy/Cargo.toml +++ b/crates/policy/Cargo.toml @@ -18,16 +18,13 @@ serde.workspace = true serde_json.workspace = true schemars = { workspace = true, optional = true } thiserror.workspace = true -tokio = { version = "1.37.0", features = ["io-util", "rt"] } +tokio.workspace = true tracing.workspace = true wasmtime = { version = "20.0.2", default-features = false, features = ["async", "cranelift", "parallel-compilation"] } mas-data-model.workspace = true oauth2-types.workspace = true -[dev-dependencies] -tokio = { version = "1.37.0", features = ["fs", "rt", "macros"] } - [features] jsonschema = ["dep:schemars"] diff --git a/crates/tasks/Cargo.toml b/crates/tasks/Cargo.toml index 220ae4fe..3d51499d 100644 --- a/crates/tasks/Cargo.toml +++ b/crates/tasks/Cargo.toml @@ -24,7 +24,7 @@ rand.workspace = true rand_chacha = "0.3.1" sqlx.workspace = true thiserror.workspace = true -tokio = { version = "1.37.0", features = ["rt"] } +tokio.workspace = true tower.workspace = true tracing.workspace = true tracing-opentelemetry.workspace = true diff --git a/crates/templates/Cargo.toml b/crates/templates/Cargo.toml index 144c2ea9..9405a793 100644 --- a/crates/templates/Cargo.toml +++ b/crates/templates/Cargo.toml @@ -14,7 +14,7 @@ workspace = true [dependencies] arc-swap = "1.7.1" tracing.workspace = true -tokio = { version = "1.37.0", features = ["macros", "rt", "fs"] } +tokio.workspace = true walkdir = "2.5.0" anyhow.workspace = true diff --git a/crates/tower/Cargo.toml b/crates/tower/Cargo.toml index 1545df20..7fbf43ee 100644 --- a/crates/tower/Cargo.toml +++ b/crates/tower/Cargo.toml @@ -16,7 +16,6 @@ http.workspace = true tracing.workspace = true tracing-opentelemetry.workspace = true tower.workspace = true -tokio = { version = "1.37.0", features = ["time"] } opentelemetry.workspace = true opentelemetry-http.workspace = true opentelemetry-semantic-conventions.workspace = true diff --git a/crates/tower/src/metrics/duration.rs b/crates/tower/src/metrics/duration.rs index f6f80f0e..cc837cc6 100644 --- a/crates/tower/src/metrics/duration.rs +++ b/crates/tower/src/metrics/duration.rs @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::future::Future; +use std::{future::Future, time::Instant}; use opentelemetry::{metrics::Histogram, KeyValue}; use pin_project_lite::pin_project; -use tokio::time::Instant; use tower::{Layer, Service}; use crate::{utils::FnWrapper, MetricsAttributes};