-
-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
currently moka allow limiting entries it stores using item weights. If a weighter is provided, the weights it returns are used, otherwise all weights are assumed to be one, which means the limit is in number of items and not based on their size.
I'd like to be able to limit both total weight, and number of items. Afaict, there isn't currently a way to do that. One thing i thought of that would allow being more generic on unusual constraints like that would be to provide an fn evict(&self) -> Option<K, V>
which evicts one item according to some application rules, while still leveraging moka's eviction policy
tatsuya6502
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request