remove a graph from the cache, locking the cache entry until the graph is dropped
(&self, key: &str)
| 121 | |
| 122 | /// remove a graph from the cache, locking the cache entry until the graph is dropped |
| 123 | pub async fn remove(&self, key: &str) { |
| 124 | let res = self |
| 125 | .cache |
| 126 | .entry_async(key, |_, _| EntryAction::<()>::ReplaceWithGuard) |
| 127 | .await; |
| 128 | |
| 129 | match res { |
| 130 | EntryResult::Replaced(_guard, graph) => { |
| 131 | blocking_compute(move || flush_graph(graph)).await; |
| 132 | } |
| 133 | _ => {} |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /// Insert a new item into the cache, replacing an existing item if it exists |
| 138 | /// The closure to create the new graph is invoked while holding a guard for the cache key |
no test coverage detected