Expand description
Redis / Valkey cache adapter (feature = “redis”)
Redis / Valkey CachePort adapter
Feature-gated behind redis. Uses [deadpool_redis] for async connection
pooling and supports optional key-prefix namespacing so multiple tenants can
share a single Redis instance without key collisions.
§Quick start
use stygian_graph::adapters::cache_redis::{RedisCache, RedisCacheConfig};
use stygian_graph::ports::CachePort;
use std::time::Duration;
let config = RedisCacheConfig {
url: "redis://127.0.0.1:6379".into(),
key_prefix: Some("myapp:".into()),
default_ttl: Some(Duration::from_secs(3600)),
pool_size: 8,
};
let cache = RedisCache::new(config)?;
cache.set("page:1", "html".into(), None).await?;Structs§
- Redis
Cache - Redis / Valkey backed
CachePortadapter. - Redis
Cache Config - Configuration for
RedisCache.