cacheflight 0.2.1

Cache-backed deduplication for async Rust services with stale-while-revalidate support
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.85"
name = "cacheflight"
version = "0.2.1"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Cache-backed deduplication for async Rust services with stale-while-revalidate support"
documentation = "https://docs.rs/cacheflight"
readme = "README.md"
keywords = [
    "cache",
    "singleflight",
    "async",
    "deduplication",
]
categories = [
    "asynchronous",
    "caching",
]
license = "MIT OR Apache-2.0"

[features]
default = ["redis"]
redis = ["dep:redis"]

[lib]
name = "cacheflight"
path = "src/lib.rs"

[[example]]
name = "basic_singleflight"
path = "examples/basic_singleflight.rs"

[[example]]
name = "probabilistic_early_expiration"
path = "examples/probabilistic_early_expiration.rs"

[[example]]
name = "stale_while_revalidate"
path = "examples/stale_while_revalidate.rs"

[[test]]
name = "cacheflight"
path = "tests/cacheflight.rs"

[[test]]
name = "redis"
path = "tests/redis.rs"

[[test]]
name = "xfetch"
path = "tests/xfetch.rs"

[[bench]]
name = "cacheflight"
path = "benches/cacheflight.rs"
harness = false

[dependencies.async-trait]
version = "0.1"

[dependencies.dashmap]
version = "6"

[dependencies.fastrand]
version = "2"

[dependencies.redis]
version = "0.28"
features = [
    "tokio-comp",
    "connection-manager",
]
optional = true

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt-multi-thread",
    "sync",
    "time",
]

[dev-dependencies.criterion]
version = "0.5"
features = ["async_tokio"]

[dev-dependencies.testcontainers]
version = "0"
features = ["tokio"]
default-features = false