use evicting_cache_map::EvictingCacheMap;
use ordered_hash_map as _;
use std::sync::mpsc;
use std::thread;
fn main() {
let (tx, rx) = mpsc::channel();
let mut cachemap: EvictingCacheMap<String, u8, 10, _> =
EvictingCacheMap::with_prune_hook(move |k, v| tx.send((k, v)).unwrap());
let send = thread::spawn(move || {
for x in 0..20 {
cachemap.insert(x.to_string(), x);
}
});
let recv = thread::spawn(move || {
while let Ok((k, v)) = rx.recv() {
println!("{k}:{v}");
}
});
let _unused = send.join();
let _unused = recv.join();
}