Expand description
Distributed cache invalidation notifications.
This module provides a system for propagating cache invalidation notifications across distributed nodes, ensuring cache consistency in the CHIE network.
§Example
use chie_core::cache_invalidation::{InvalidationNotifier, InvalidationEvent, InvalidationReason};
use std::sync::Arc;
let notifier = InvalidationNotifier::new();
// Subscribe to invalidation events
let mut receiver = notifier.subscribe();
// Invalidate a specific cache entry
notifier.invalidate_key("content:QmTest123", InvalidationReason::Updated).await;
// Receive the invalidation event
if let Some(event) = receiver.recv().await {
println!("Cache invalidated: {:?}", event.key);
}Structs§
- Batch
Invalidation - Batch invalidation manager for efficient bulk operations.
- Invalidation
Event - Cache invalidation event.
- Invalidation
Notifier - Cache invalidation notifier for distributed systems.
- Invalidation
Receiver - Receiver for invalidation events.
- Invalidation
Stats - Statistics for cache invalidation.
Enums§
- Invalidation
Error - Errors that can occur during cache invalidation.
- Invalidation
Pattern - Pattern for matching cache keys during invalidation.
- Invalidation
Reason - Reason for cache invalidation.