-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change CacheState.register to a fluent API #1920
Conversation
9c035df
to
56d3e87
Compare
56d3e87
to
c788bb5
Compare
Generate changelog in
|
*/ | ||
public <K, V, C extends Cache<K, V>> C register(C cache) { | ||
public <K, V, C extends Cache<K, V>> C register(Function<CacheStats, C> cacheFactory) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
Released 0.85.0 |
One nice thing about this API is that it makes it difficult to forget to call |
Before this rolls out broadly, could we add a check to throw if stats aren't being recorded (which implies the cacheStats value hasn't been provided to the builder)? |
Follow up from #1919
This is a slightly less obvious but more ergonomic API for consumers.