[package]
name = "acktor"
version = "1.1.1"
description = "Pure-Rust actor framework built on top of the Tokio async runtime"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
categories.workspace = true
readme = "../README.md"
keywords.workspace = true
exclude = ["examples/*", "tests/*"]

[package.metadata.docs.rs]
all-features = true
rustc-args = ["--cfg", "tokio_unstable"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["derive", "observer", "cron"]
derive = ["dep:acktor-derive"]
observer = ["dep:ahash"]
cron = []
# a stable unique identifier for types
identifier = ["dep:sha2-const"]
# use prost to encode/decode primitive types, the default implementation mixes zerocopy and
# prost, which is not ideal for cross-language use cases
prost-codec = []
# marker feature, enable the ipc related dependencies
ipc = [
    "identifier",
    "dep:acktor-ipc-proto",
    "dep:bytes",
    "dep:prost",
    "dep:zerocopy",
    "acktor-derive?/ipc",
]
# emits debug-level tracing logs when an observer's mailbox is full and becomes a bottleneck
bottleneck-warning = []
# enables tokio's unstable tracing features, requires `tokio_unstable` rust flag
tokio-tracing = ["tokio/tracing"]

[dependencies]
disqualified.workspace = true
futures-util.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["macros", "rt", "sync", "time"] }
tracing.workspace = true

ahash = { workspace = true, optional = true }
bytes = { workspace = true, optional = true }
prost = { workspace = true, optional = true }
sha2-const = { workspace = true, optional = true }
zerocopy = { workspace = true, optional = true }

acktor-derive = { workspace = true, optional = true }
acktor-ipc-proto = { workspace = true, optional = true, default-features = false }

[dev-dependencies]
anyhow.workspace = true
clap.workspace = true
pretty_assertions.workspace = true
rkyv.workspace = true
serde.workspace = true
serde_json.workspace = true

[[example]]
name = "ring"
required-features = ["derive"]

[[test]]
name = "test_basic"
required-features = ["derive"]

[[test]]
name = "test_codec"
required-features = ["derive", "ipc"]

[[test]]
name = "test_cron_context"
required-features = ["cron"]

[[test]]
name = "test_cron"
required-features = ["cron"]

[[test]]
name = "test_identifier"
required-features = ["derive", "identifier"]

[[test]]
name = "test_observer"
required-features = ["observer"]
