Skip to content

How to disable LFU admission filter? #388

Answered by tatsuya6502
PhotonQuantum asked this question in Q&A
Discussion options

You must be logged in to vote

@PhotonQuantum

This seems an easy task for me. If you can wait for a few days, perhaps I can implement it.

OK. I implemented the LRU policy via #390 and published v0.12.5 to crates.io. The LRU policy has the LFU admission filter disabled.

# Cargo.toml

[dependencies]
moka = { version = "0.12.5", features = ["sync"] }
use std::time::Duration;
use moka::{policy::EvictionPolicy, sync::Cache};

let cache = Cache::builder()
    .eviction_policy(EvictionPolicy::lru())
    .max_capacity(...)  // optional
    .time_to_idle((Duration::from_secs(...))
    .support_invalidation_closures()
    .build();

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tatsuya6502
Comment options

@ben-manes
Comment options

@tatsuya6502
Comment options

Answer selected by PhotonQuantum
@PhotonQuantum
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants