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 iterate/query items in the cache #45

Open
ithinkicancode opened this issue Aug 26, 2021 · 1 comment
Open

Ability to iterate/query items in the cache #45

ithinkicancode opened this issue Aug 26, 2021 · 1 comment

Comments

@ithinkicancode
Copy link
Contributor

ithinkicancode commented Aug 26, 2021

Motivation

Currently there is no easy way to iterate through or query against the items in the cache. There might be cases where you would like to do that (debugging comes to mind).

Considerations

Maybe we can provide either an iterator or a query/filter interface to users for this purpose. However, we'll need to take potential performance impact and data consistency into account:

  1. Any query only represents a snapshot of the cache at a particular moment.
  2. We probably shouldn't keep additional copies of data to hold this snapshot just for this purpose
@fourth44
Copy link

It would be especially nice to iterate the items in the exact order as they appear in 'KeySet', so it is possible to remove/invalidate items exactly like when size > capacity (remove least recently used first), but then at arbitrary moments (e.g. to alleviate memory pressure).

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

No branches or pull requests

2 participants