Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to invalidate the entire cache? #10

Closed
jamesbirtles opened this issue Feb 26, 2021 · 4 comments · Fixed by #12
Closed

Ability to invalidate the entire cache? #10

jamesbirtles opened this issue Feb 26, 2021 · 4 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@jamesbirtles
Copy link

A use case has come up where I'd like to invalidate the entire cache (or perhaps invalidate based on a predicate on the values). I'm not seeing any way to do this at the moment. I am using the future based cache.

@tatsuya6502 tatsuya6502 added the enhancement New feature or request label Feb 27, 2021
@tatsuya6502 tatsuya6502 self-assigned this Feb 27, 2021
@tatsuya6502
Copy link
Member

tatsuya6502 commented Feb 27, 2021

Hi. I started to implement invalidate_all method, which will invalidate the entire cache. (#11)

Once I am done with it, I will start to work on invalidate_entries_if method, which will take a predicate and invalidate entries that meet the predicate.

I will let you know when they are ready.

@jamesbirtles
Copy link
Author

Awesome! 🎉

@tatsuya6502
Copy link
Member

@UnwrittenFun — I just published Moka 0.3.0 to crates.io. It has invalidate_all method and I hope you will like it. (API doc)

I will keep this issue open until I finish implementing invalidate_entries_if method.

@tatsuya6502
Copy link
Member

I will keep this issue open until I finish implementing invalidate_entries_if method.

Finally, I finished implementing this method (PR #12). It takes a predicate and invalidate entries that satisfy the predicate. (key: &K and value: &V are passed to the predicate) The invalidation is processed by a background thread and client reads/writes will not be blocked while running the invalidation.

I am running some load tests now. If they go well, I will merge the PR and release Moka v0.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants