risingwave_common::cache

Trait LruCacheEventListener

source
pub trait LruCacheEventListener: Send + Sync {
    type K: LruKey;
    type T: LruValue;

    // Provided method
    fn on_release(&self, _key: Self::K, _value: Self::T) { ... }
}

Required Associated Types§

Provided Methods§

source

fn on_release(&self, _key: Self::K, _value: Self::T)

on_release is called when a cache entry is erased or evicted by a new inserted entry.

Note: on_release will not be triggered when the LruCache and its inner entries are dropped.

Implementors§