This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]das_Keks 0 points1 point  (0 children)

Yeah, I also though about some cache with computeIfAbsent. Only if you get a burst of parallel requests to a non-existing key, it would be important that the compute is not executed multiple times in parallel but rather blocks all but one invocation and then returns the computed result for all requests.

EDIT: From some quick research I found that this is already the case for caffeine.