Module cache_invalidation

Module cache_invalidation 

Source
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§

BatchInvalidation
Batch invalidation manager for efficient bulk operations.
InvalidationEvent
Cache invalidation event.
InvalidationNotifier
Cache invalidation notifier for distributed systems.
InvalidationReceiver
Receiver for invalidation events.
InvalidationStats
Statistics for cache invalidation.

Enums§

InvalidationError
Errors that can occur during cache invalidation.
InvalidationPattern
Pattern for matching cache keys during invalidation.
InvalidationReason
Reason for cache invalidation.