MCPcopy Create free account
hub / github.com/erans/pgsqlite / create_and_register_cache

Method create_and_register_cache

src/cache/memory_aware_manager.rs:203–211  ·  view source on GitHub ↗

Create and register a new TTL cache

(&self, name: String)

Source from the content-addressed store, hash-verified

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) {

Callers 3

create_global_cacheFunction · 0.80
test_cache_statsFunction · 0.80

Calls 3

create_cacheMethod · 0.80
register_cacheMethod · 0.80
cloneMethod · 0.45

Tested by 2

test_cache_statsFunction · 0.64