Hi,
I have a question about the max_cost argument in the AsyncCache. When I set it to 2 and insert 2 item each have 1 cost, then one of the item is missing. Maybe I misinterpret something here. Code:
use stretto::AsyncCache;
#[tokio::main]
async fn main() {
let c = AsyncCache::new(20, 2, tokio::spawn).unwrap();
c.insert(1, 2, 1).await;
c.insert(2, 3, 1).await;
c.wait().await.unwrap();
c.get(&1).unwrap(); // Get a panic
}
Hi, I have a question about the
max_cost
argument in theAsyncCache
. When I set it to 2 and insert 2 item each have 1 cost, then one of the item is missing. Maybe I misinterpret something here. Code: