Skip to content

Conversation

ilyatotl
Copy link

@ilyatotl ilyatotl commented Jul 18, 2025

Description

Often, Ristretto is used not only as a cache before databases, but also as a complete in-memory storage. And there are cases when you need to do something with all the elements in the cache (for example, completely unload them and send them somewhere). However, in the current implementation, this is impossible. For this, the Iter function was implemented, which goes through all the cache elements and calls a callback function for each one of them.

P.S. In addition, when running the tests, it was noticed that they were running for quite a long time, so they were parallelized, which significantly accelerated their work.

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable

@ilyatotl ilyatotl requested a review from a team as a code owner July 18, 2025 16:27
Copy link
Member

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Do we need to change the API here at all for having iteration function? If not, I'd recommend breaking this PR into two. It would be easy to get one in that does not change the API, and only adds a new API. We can later on review the other one if and when we plan for a major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants