RemovalCause #843
-
Hi Ben, In my use case, when an entry is expired or explicity removed, under certain conditions I must recache it by calling a supplier api. But this must not be perfomed in case of a clear ("invalidateAll()"). So I was wondering if it would be possible to create a new RemovalCause, something like CLEAR, which is also EXPLICIT (it would be like SIZE, which is also an eviction like EXPIRED). EXPLICIT { So if the removal listener receives a CLEAR for an entry, I will not recache it. Thanks, Joan. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Have you looked into whether refreshing would be a fit instead? This asynchronously reloads the entry, either by an explicit call (LoadingCache#refresh) or if accessed after a duration (refreshAfterWrite). The examples dir has a contribution showing how to coalesce multiple reloads into a batch call for efficiency. |
Beta Was this translation helpful? Give feedback.
Have you looked into whether refreshing would be a fit instead? This asynchronously reloads the entry, either by an explicit call (LoadingCache#refresh) or if accessed after a duration (refreshAfterWrite). The examples dir has a contribution showing how to coalesce multiple reloads into a batch call for efficiency.