[package]
edition = "2021"
rust-version = "1.82.0"
name = "proc-daemon"
version = "1.0.0"
authors = ["James Gober <codeca@jamesgober.dev>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A foundational framework for building high-performance, resilient daemon services in Rust. Handles all the boilerplate for signal handling, graceful shutdown, logging, and configuration."
homepage = "https://github.com/jamesgober/proc-daemon"
documentation = "https://docs.rs/proc-daemon"
readme = "README.md"
keywords = [
"daemon",
"cross-platform",
"systemd",
"process",
"service",
]
categories = [
"os::unix-apis",
"os::windows-apis",
"development-tools",
"network-programming",
"concurrency",
]
license = "Apache-2.0"
repository = "https://github.com/jamesgober/proc-daemon"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
async-std = ["dep:async-std"]
backtrace = []
config-watch = ["notify"]
console = ["dep:console"]
default = [
"tokio",
"toml",
]
full = [
"tokio",
"metrics",
"console",
"json-logs",
"config-watch",
"ipc",
]
heap-profiling = ["dep:dhat"]
high-res-timing = ["dep:quanta"]
ipc = ["tokio"]
json-logs = [
"serde_json",
"serde",
]
lockfree-coordination = ["dep:crossbeam-channel"]
metrics = ["dep:metrics"]
mimalloc = ["dep:mimalloc"]
mmap-config = ["dep:memmap2"]
profiling = ["dep:pprof"]
scheduler-hints = []
scheduler-hints-unix = [
"scheduler-hints",
"nix/resource",
]
serde = []
tokio = ["dep:tokio"]
windows-monitoring = ["windows"]
[lib]
name = "proc_daemon"
path = "src/lib.rs"
[[example]]
name = "comprehensive"
path = "examples/comprehensive.rs"
[[example]]
name = "hot_reload"
path = "examples/hot_reload.rs"
[[example]]
name = "metrics_server"
path = "examples/metrics_server.rs"
[[example]]
name = "simple"
path = "examples/simple.rs"
[[test]]
name = "async_std_tests"
path = "tests/async_std_tests.rs"
[[test]]
name = "integration"
path = "tests/integration.rs"
[[bench]]
name = "daemon_bench"
path = "benches/daemon_bench.rs"
harness = false
required-features = ["tokio"]
[dependencies.arc-swap]
version = "1.7"
[dependencies.async-std]
version = "1.12"
features = ["attributes"]
optional = true
[dependencies.console]
version = "0.15"
optional = true
[dependencies.crossbeam]
version = "0.8"
[dependencies.crossbeam-channel]
version = "0.5"
optional = true
[dependencies.dashmap]
version = "6.0"
[dependencies.dhat]
version = "0.3"
optional = true
[dependencies.fastrand]
version = "2.0"
[dependencies.figment]
version = "0.10"
features = [
"toml",
"env",
"json",
]
[dependencies.fs2]
version = "0.4.3"
[dependencies.futures]
version = "0.3"
[dependencies.memmap2]
version = "0.9"
optional = true
[dependencies.metrics]
version = "0.17"
optional = true
[dependencies.mimalloc]
version = "0.1"
optional = true
[dependencies.notify]
version = "6.1"
optional = true
[dependencies.num_cpus]
version = "1.16.0"
[dependencies.once_cell]
version = "1.19"
[dependencies.parking_lot]
version = "0.12"
[dependencies.pprof]
version = "0.13"
features = ["prost-codec"]
optional = true
[dependencies.quanta]
version = "0.12"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
optional = true
[dependencies.thiserror]
version = "1.0"
[dependencies.tokio]
version = "1.37"
features = [
"rt-multi-thread",
"macros",
"sync",
"time",
"signal",
"process",
"io-util",
"net",
"fs",
]
optional = true
[dependencies.toml]
version = "0.8"
optional = true
[dependencies.tracing]
version = "0.1"
features = ["std"]
[dependencies.tracing-subscriber]
version = "0.3.20"
features = [
"env-filter",
"json",
"fmt",
"ansi",
"registry",
]
[dev-dependencies.criterion]
version = "0.5"
features = ["html_reports"]
[dev-dependencies.proptest]
version = "1.6"
[dev-dependencies.serial_test]
version = "3.0"
[dev-dependencies.tempfile]
version = "3.8"
[dev-dependencies.tokio-test]
version = "0.4"
[target."cfg(unix)".dependencies.ctrlc]
version = "3.4"
[target."cfg(unix)".dependencies.libc]
version = "0.2"
[target."cfg(unix)".dependencies.nix]
version = "0.29"
features = [
"signal",
"sched",
]
[target."cfg(unix)".dependencies.signal-hook]
version = "0.3"
[target."cfg(unix)".dependencies.signal-hook-async-std]
version = "0.2"
[target."cfg(windows)".dependencies.ctrlc]
version = "3.4"
[target."cfg(windows)".dependencies.windows]
version = "0.58"
features = [
"Win32_Foundation",
"Win32_System_Threading",
"Win32_System_ProcessStatus",
"Win32_System_Diagnostics_ToolHelp",
]
optional = true
[profile.bench]
debug = 2
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
strip = true