Skip to content
Discussion options

You must be logged in to vote

Sorry, busy day and I focused on the last question only.

Yes, the refresh assists for the future requests and not the one that triggered it. Technically if the asyncReload returns an immediate CompletableFuture then its value is returned, but since reloads are non-blocking a concurrent read would still observe the current (stale) value. Since the future may take a while to complete, the current value is returned until the future is resolved or the entry is otherwise evicted (e.g. it expired). In the case where the entry was updated or removed then the reload is abandoned and its value forwarded to the removal listener.

The feature is sometimes referred to as soft vs hard time-to-live (our…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ben-manes
Comment options

Answer selected by ben-manes
@raindel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants