Open GoogleCodeExporter opened 9 years ago
Original comment by eric.dalquist
on 20 Sep 2011 at 1:57
Maybe allow dispatching the cache refresh in another thread while letting the
first request come back from cache?
Original comment by osborn.j...@gmail.com
on 23 Jan 2012 at 7:26
[deleted comment]
I think that starting a second thread that calls the real method and populates
the cache is the obvious solution.
The scenario for this enhancement request is very usual:
You have a costly process that you cache but need to refresh sometimes.
You want that refresh to happen under your control as an administrator.
You do not want just to clean the cache and let the next unlucky normal user
that calls the method to populate because his request would be too slow.
Even worse, if the method is called concurrently you will have a number of
threads competing to populate the cache!
Original comment by jgalleg...@gmail.com
on 24 Jan 2012 at 3:25
I think it would be relatively trivial to keep a list of thread Future objects
keyed by the cache hash code to indicate that a 're-population' is in progress
for a particular hash entry by key. Also, using a thread pool, the number of
simultaneous requests could be controlled/configured.
Original comment by osborn.j...@gmail.com
on 24 Jan 2012 at 4:53
Original issue reported on code.google.com by
jgalleg...@gmail.com
on 18 Jul 2011 at 3:05