java - Implementing cache using Guava -
i want implement cache using guava's caching mechanism.
i have db query returns map, want cache entire map let expire after amount of time.
i realize guava caches works per-item bases. provide key, cache either returns corresponding value cache or it.
is there way use guava everything, cache timeout after time period of time , again.
many thanks
you can create instance of supplier<map<k,v>>
fetches entire map database, , use suppliers.memoizewithexpiration
cache it.
related:
Comments
Post a Comment