pub struct InvalidationSubscriber { /* private fields */ }Expand description
Handle for subscribing to invalidation messages
This spawns a background task that listens to Redis Pub/Sub and processes invalidation messages by calling the provided handler callback.
Implementations§
Source§impl InvalidationSubscriber
impl InvalidationSubscriber
Sourcepub fn new(redis_url: &str, config: InvalidationConfig) -> CacheResult<Self>
pub fn new(redis_url: &str, config: InvalidationConfig) -> CacheResult<Self>
Sourcepub fn stats(&self) -> InvalidationStats
pub fn stats(&self) -> InvalidationStats
Get a snapshot of current statistics
Sourcepub fn start<F, Fut>(&self, handler: F) -> JoinHandle<()>where
F: Fn(InvalidationMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = CacheResult<()>> + Send + 'static,
pub fn start<F, Fut>(&self, handler: F) -> JoinHandle<()>where
F: Fn(InvalidationMessage) -> Fut + Send + Sync + 'static,
Fut: Future<Output = CacheResult<()>> + Send + 'static,
Auto Trait Implementations§
impl Freeze for InvalidationSubscriber
impl !RefUnwindSafe for InvalidationSubscriber
impl Send for InvalidationSubscriber
impl Sync for InvalidationSubscriber
impl Unpin for InvalidationSubscriber
impl UnsafeUnpin for InvalidationSubscriber
impl !UnwindSafe for InvalidationSubscriber
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