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

Remove :stats and :limit from the list of cache options #374

Merged
merged 5 commits into from
Sep 19, 2024
Merged

Conversation

whitfin
Copy link
Owner

@whitfin whitfin commented Sep 19, 2024

This fixes #368.

There's a lot in here, but the gist is that :stats and :limit have been completely removed in favour of simply providing the hooks directly. This is a much smaller implementation, and is easier to understand (because we're guiding everyone to hooks).

This also introduces a new cache action via Cachex.prune/3 which can be used to manually prune a cache to a size. This is used by the hooks under the hood.

Hook records have also had :state => :args to better show that they can have modified state, more inline with GenServer.

@whitfin whitfin added this to the v4.0.0 milestone Sep 19, 2024
@whitfin whitfin self-assigned this Sep 19, 2024
@whitfin whitfin merged commit 86a1bf7 into main Sep 19, 2024
16 checks passed
@whitfin whitfin deleted the issue-368 branch September 19, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Cachex.Policy in favour of hooks
1 participant