[package]
name = "cruster"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
description = "A Rust framework for building distributed, stateful entity systems with durable workflows"
readme = "../../README.md"

[dependencies]
# Async
tokio = { workspace = true }
async-trait = { workspace = true }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-util = { version = "0.7" }
futures = "0.3"

# Serialization
serde = { workspace = true }
rmp-serde = "1"
serde_json = { workspace = true }

# gRPC
tonic = "0.12"
prost = "0.13"

# Errors
thiserror = { workspace = true }

# Concurrency
dashmap = "6"
parking_lot = "0.12"

# Metrics
prometheus = { workspace = true }

# Time
chrono = { workspace = true }
cron = "0.13"

# Tracing
tracing = { workspace = true }

# OpenTelemetry (optional)
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
tracing-opentelemetry = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }

# Macros
cruster-macros = { workspace = true }

# SQL storage (required for workflow activity transactions)
sqlx = { version = "0.8", features = ["runtime-tokio", "postgres", "tls-rustls", "migrate", "chrono"] }

# etcd storage (optional)
etcd-client = { version = "0.14", optional = true }

# Consistent hashing (optional)
hashring = { version = "0.3", optional = true }

# Parallel computation (optional)
rayon = { version = "1.10", optional = true }

[features]
default = []
etcd = ["dep:etcd-client"]
consistent-hash = ["dep:hashring"]
parallel = ["dep:rayon"]
otel = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-otlp", "dep:tracing-opentelemetry", "dep:tracing-subscriber"]

[build-dependencies]
tonic-build = "0.12"

[dev-dependencies]
proptest = { workspace = true }
criterion = { workspace = true }
trybuild = "1"
testcontainers = "0.23"
testcontainers-modules = { version = "0.11", features = ["postgres"] }
etcd-client = "0.14"

[[bench]]
name = "shard_assignment"
harness = false
