Crates.io | lathe |
lib.rs | lathe |
version | 0.0.0 |
source | src |
created_at | 2022-08-25 09:57:39.229278 |
updated_at | 2022-08-25 09:57:39.229278 |
description | scan resistant concurrent cache eviction manager |
homepage | https://github.com/komora-io/lathe |
repository | https://github.com/komora-io/lathe |
max_upload_size | |
id | 652061 |
size | 21,398 |
API:
impl CacheAdvisor {
/// Create a new advisor.
pub fn new(capacity: usize) -> CacheAdvisor { .. }
/// Mark items that are accessed with a certain cost.
/// Returns the items that should be evicted and their associated costs
pub fn accessed(&mut self, id: u64, cost: usize) -> Vec<(u64, usize)> { .. }
}
Implementation details:
try_lock