eventuali_core/performance/
caching.rs

1//! Multi-level caching with eviction policies
2//!
3//! Provides high-performance caching layers for event data.
4
5/// Cache configuration
6#[derive(Debug, Clone)]
7pub struct CacheConfig {
8    pub max_size: usize,
9    pub ttl_seconds: u64,
10    pub eviction_policy: EvictionPolicy,
11}
12
13#[derive(Debug, Clone)]
14pub enum EvictionPolicy {
15    LRU,
16    LFU,
17    FIFO,
18}
19
20impl Default for CacheConfig {
21    fn default() -> Self {
22        Self {
23            max_size: 10000,
24            ttl_seconds: 3600,
25            eviction_policy: EvictionPolicy::LRU,
26        }
27    }
28}
29
30/// Cache manager
31pub struct CacheManager {
32    #[allow(dead_code)] // Cache configuration settings (stored but not currently accessed in implementation)
33    config: CacheConfig,
34}
35
36impl CacheManager {
37    pub fn new(config: CacheConfig) -> Self {
38        Self { config }
39    }
40}