Skip to content

Conversation

@Sammster10
Copy link
Member

@Sammster10 Sammster10 commented Jan 13, 2026

This adds a function, similar to fallback values, which allows a value to be recalculated and set in Redis via #refresh(). The more powerful feature is that this value is automatically set in Redis when the current value is null (it has expired) and a call to #get() is made, returning the new refreshed value.

Thus allowing CachedValues to support proper cache invalidation, via @ExpireAfter(...) and proper repopulation/on-demand recalculation via a .refresher(...)

Supersedes #30

@Sammster10 Sammster10 requested a review from Leguan16 January 13, 2026 22:51
@Sammster10 Sammster10 linked an issue Jan 13, 2026 that may be closed by this pull request
@Leguan16 Leguan16 merged commit 8a7ba1d into master Jan 13, 2026
1 check failed
@Sammster10 Sammster10 deleted the feat/cached-value-refresh branch January 13, 2026 23:49
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.

Add RefreshSupplier to CachedValues

3 participants