Skip to main content

register_invalidator

Function register_invalidator 

Source
pub fn register_invalidator<E, F>(cache: Arc<Cache>, key_fn: F)
where E: Event, F: Fn(&E) -> Vec<String> + Send + Sync + 'static,
Expand description

Register a cache-invalidation listener on the process-wide global_dispatcher.

Convenience wrapper around register_invalidator_on; see that function for the full behavioural contract. This is the right entry point for app-boot wiring where events are dispatched via the ergonomic event.dispatch().await Laravel-style API.

ยงExample

See the crate-level documentation for a complete wiring example.