[package]
name = "commonware-runtime"
edition.workspace = true
publish = true
version.workspace = true
license.workspace = true
description = "Execute asynchronous tasks with a configurable scheduler."
readme = "README.md"
homepage.workspace = true
repository = "https://github.com/commonwarexyz/monorepo/tree/main/runtime"
documentation = "https://docs.rs/commonware-runtime"

[lints]
workspace = true

[dependencies]
async-lock.workspace = true
bytes.workspace = true
cfg-if.workspace = true
commonware-codec.workspace = true
commonware-macros.workspace = true
commonware-utils = { workspace = true, features = ["std"] }
futures.workspace = true
governor.workspace = true
io-uring = { workspace = true, optional = true }
libc.workspace = true
opentelemetry.workspace = true
pin-project = { workspace = true, optional = true }
prometheus-client.workspace = true
rand.workspace = true
rayon.workspace = true
sha2.workspace = true
sysinfo.workspace = true
thiserror.workspace = true
tracing.workspace = true
tracing-opentelemetry.workspace = true
tracing-subscriber = { workspace = true, features = ["fmt", "json", "env-filter"] }

[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
# Enable "js" feature when WASM is target
version = "0.2.15"
features = ["js"]

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
axum.workspace = true
console-subscriber = { workspace = true, features = ["parking_lot"], optional = true }
criterion = { workspace = true, features = ["async"] }
opentelemetry-otlp = { workspace = true, features = ["http-proto"] }
opentelemetry_sdk = { workspace = true, features = ["rt-tokio"] }
tokio = { workspace = true, features = ["full"] }

[features]
default = []
external = [ "pin-project" ]
test-utils = []
iouring-storage = [ "io-uring" ]
iouring-network = [ "io-uring" ]
tokio-console = [ "dep:console-subscriber", "tokio/tracing" ]

[lib]
bench = false
crate-type = ["rlib", "cdylib"]
