MCPcopy Index your code
hub / github.com/Firstyear/opensuse-proxy-cache / new

Method new

opensuse-proxy-cache/src/memcache.rs:66–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64
65impl MemCache {
66 pub fn new() -> MemCache {
67 let map = Arc::new(HashMap::new());
68 let map_cln = map.clone();
69 let (submit_tx, submit_rx) = channel(PENDING_ADDS);
70 // This launches our task too.
71 let _ = tokio::task::spawn(async move {
72 cache_mgr(map_cln, submit_rx).await
73 });
74
75 MemCache {
76 map,
77 submit_tx,
78 }
79 }
80
81 pub fn get(&self, req_path: &str) -> Option<Arc<MemCacheObj>> {
82 let rtxn = self.map.read();

Callers

nothing calls this directly

Calls 1

cache_mgrFunction · 0.70

Tested by

no test coverage detected