Create and register a new TTL cache
(&self, name: String)
| 201 | |
| 202 | /// Create and register a new TTL cache |
| 203 | pub fn create_and_register_cache<K, V>(&self, name: String) -> Arc<TtlCache<K, V>> |
| 204 | where |
| 205 | K: Eq + std::hash::Hash + Clone + Send + Sync + 'static, |
| 206 | V: Clone + Send + Sync + 'static, |
| 207 | { |
| 208 | let cache = Arc::new(self.cache_factory.create_cache()); |
| 209 | self.register_cache(name, cache.clone()); |
| 210 | cache |
| 211 | } |
| 212 | |
| 213 | /// Check memory pressure and take action if needed |
| 214 | pub fn check_memory_pressure(&self) { |