pub struct WalInvalidator { /* private fields */ }Expand description
WAL-based cache invalidator
Implementations§
Source§impl WalInvalidator
impl WalInvalidator
Sourcepub fn new(config: DistribCacheConfig) -> Self
pub fn new(config: DistribCacheConfig) -> Self
Create a new invalidator
Sourcepub async fn start(&self, wal_endpoint: &str) -> CacheResult<()>
pub async fn start(&self, wal_endpoint: &str) -> CacheResult<()>
Start the invalidator - connects to WAL endpoint and begins processing
Sourcepub fn start_processing(&self) -> JoinHandle<()>
pub fn start_processing(&self) -> JoinHandle<()>
Start the WAL processing loop in a background task
Sourcepub async fn process_loop(&self)
pub async fn process_loop(&self)
Process WAL entries in the current task (blocking)
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if running
Sourcepub fn register(&self, table: &str, fingerprint: QueryFingerprint)
pub fn register(&self, table: &str, fingerprint: QueryFingerprint)
Register a cache fingerprint for a table
Sourcepub fn unregister(&self, table: &str, fingerprint: &QueryFingerprint)
pub fn unregister(&self, table: &str, fingerprint: &QueryFingerprint)
Unregister a fingerprint
Sourcepub async fn add_callback(&self, callback: InvalidationCallback)
pub async fn add_callback(&self, callback: InvalidationCallback)
Add invalidation callback
Sourcepub fn add_callback_sync(&self, callback: InvalidationCallback)
pub fn add_callback_sync(&self, callback: InvalidationCallback)
Add callback (sync version for compatibility)
Sourcepub async fn invalidate_table_manual(&self, table: &str, all_entries: bool)
pub async fn invalidate_table_manual(&self, table: &str, all_entries: bool)
Manually invalidate a table (public API)
Sourcepub fn stats(&self) -> InvalidatorStatsSnapshot
pub fn stats(&self) -> InvalidatorStatsSnapshot
Get invalidator statistics
Auto Trait Implementations§
impl !Freeze for WalInvalidator
impl !RefUnwindSafe for WalInvalidator
impl Send for WalInvalidator
impl Sync for WalInvalidator
impl Unpin for WalInvalidator
impl UnsafeUnpin for WalInvalidator
impl !UnwindSafe for WalInvalidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more