Can caffine cache removal listener may get called multiple times(concurrently) for the same entry

46 views Asked by At

Can caffine cache removal listener may get called multiple times(concurrently) for the same entry. Lets say Entry<Key,Value> is removed. Can removal listener run multiple times(concurrently)for this Value?

My expectation is that removal listener thead will pick this Value only once and no two thread will get this Value.

1

There are 1 answers

1
Valerij Dobler On

Yes, take a look at the GitHub documentation.

Caffeine provides an in-memory cache using a Google Guava inspired API. The improvements draw on our experience designing Guava's cache and ConcurrentLinkedHashMap.