dnrajugade / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Refresh proactively as part of periodic cache maintenance? #1200

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now if your CacheLoader.refresh() is implemented asynchronously, then we 
sometimes hand out stale values. Meanwhile if it's synchronous then it's often 
not a _lot_ better than just having expired the value.

Either way this may not be what most users expect.

Instead we could refresh entries during regular cache cleanup.

The down side is that this could turn into a LOT more work for the hapless 
get() call that gets stuck doing it -- no longer just expiring and calling 
listeners, but doing potentially expensive loads.   But, the user does have the 
ability to limit that damage using expireAfterAccess.

We think this would also address the problem cited in issue 835?

Original issue reported on code.google.com by kevinb@google.com on 9 Nov 2012 at 10:59

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 12 Mar 2013 at 6:43

GoogleCodeExporter commented 9 years ago
Does anyone out there want/need this or have thoughts to share?

Original comment by kevinb@google.com on 12 Mar 2013 at 6:50

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:18

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08