Skip to content

Conversation

@ben-manes
Copy link
Contributor

This is derived from the Guava module. The changes were,

  • Replace Guava types with Caffeine's (Cache, LoadingCache, CaffeineSpec)
  • Add AsyncLoadingCache support
  • Update documentation, modules, etc.

Note that AsyncLoadingCache does not extend the Cache interface due to some minor differences. It would ideally be a LoadingCache<K, CompletableFuture<V>>, but that would require allowing a null return value (as Caffeine does not throw an exception on a cache miss). To support this type, doWithAsync was added along with AsyncCallback. The private callback instance has weaker type safety, but is internal so this has no negative effect. That approach allowed for making the most minimal changes from the original Guava code.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 99.824% when pulling b5acf6e on ben-manes:master into 32c4f06 on jooby-project:master.

@@ -0,0 +1,128 @@
# caffeine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this file to md/doc/caffeine/caffeine.md. The release tool will create this file later.

@jknack
Copy link
Member

jknack commented Aug 27, 2016

looks great! just did some minor comments

@jknack jknack added the feature label Aug 27, 2016
@jknack jknack added this to the 1.0.0 milestone Aug 27, 2016
@ben-manes
Copy link
Contributor Author

Done. Added myself as secondary author, since your code was changed in only minor ways when adapting. I also just released a new minor version with an enhancement in a sibling module. That might cause a build break until Sonatype staging fully replicates to Central.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 99.824% when pulling 09288c8 on ben-manes:master into 32c4f06 on jooby-project:master.

@jknack jknack merged commit e3812f1 into jooby-project:master Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants