Closed rsdy closed 1 year ago
It looks like something like HashMap::consume_async<F: FnMut(K, V) -> Option<(K, V)>>
or OccupiedEntry::remove_next() -> V
should be implemented.
I'll implement something in a couple of weeks!
Hi, implemented prune
and prune_async
.
So, the usage would be,
let mut to_upsert = vec![];
self.cache.prune_async(|_, v| {
if v.fresh {
to_upsert.push(v);
None
} else {
Some(v)
}
}).await;
=> v1.8.2 (to be published soon).
It is a very common use-case for us in
bloop
to use a parallel process to create ascc::HashMap
, then split that hashmap based on various properties. Currently I do this:It would be great if I had a native way to help do this.