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

Strip out :qlc from LRW implementation #354

Merged
merged 1 commit into from
Aug 25, 2024
Merged

Strip out :qlc from LRW implementation #354

merged 1 commit into from
Aug 25, 2024

Conversation

whitfin
Copy link
Owner

@whitfin whitfin commented Aug 25, 2024

This fixes #329. Rather than fix the issue with :qlc, I figured it might just be best to avoid it directly.

Instead we now use Cachex.stream/2 for the LRW policy, which under the hood now uses :ets.select/3 thanks to #352. This means the implementation is now much easier to understand, and is just built on top of other Cachex structures. I'm not sure if there's a performance hit, my benchmarking was inconclusive (although there's a chance it's faster, even?).

I also took the opportunity to rename Cachex.Query.create/2 to Cachex.Query.where/2 as this now reads a bit better (even if it could still be improved):

# what does this mean?
Cachex.Query.create(true)

# "where true" implies "all"
Cachex.Query.where(true)

@whitfin whitfin added this to the v4.0.0 milestone Aug 25, 2024
@whitfin whitfin self-assigned this Aug 25, 2024
@whitfin whitfin merged commit 1be71d4 into main Aug 25, 2024
13 checks passed
@whitfin whitfin deleted the issue-329 branch August 25, 2024 06:56
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

Successfully merging this pull request may close these issues.

qlc error - max limit cache eviction fails for no cwd write permissions
1 participant