Skip to content
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

Create a SupplierBuilder just like CacheBuilder #1773

Closed
gissuebot opened this issue Oct 31, 2014 · 3 comments
Closed

Create a SupplierBuilder just like CacheBuilder #1773

gissuebot opened this issue Oct 31, 2014 · 3 comments

Comments

@gissuebot
Copy link

gissuebot commented Oct 31, 2014

Original issue created by jens.ran...@tink.se on 2014-06-02 at 07:22 PM


This is related to #1772.

There are a lot of similarities between a Cache and a Supplier. Really, a Supplier is a specific case of a LoadingCache with a single key. Since the CacheBuilder has become a useful pattern of constructing a Cache I propose creating a SupplierBuilder that incorporates much of the same properties as a CacheBuilder. This would make it easy to have weak/soft references (see #1772), different eviction strategies as well as removalListener.

@gissuebot
Copy link
Author

Original comment posted by cpovirk@google.com on 2014-06-02 at 07:23 PM


Issue #1772 has been merged into this issue.

@gissuebot
Copy link
Author

Original comment posted by lowasser@google.com on 2014-06-02 at 07:24 PM


(No comment entered for this change.)


Status: Duplicate
Merged Into: #872

@gissuebot
Copy link
Author

gissuebot commented Nov 1, 2014

Original comment posted by jens.ran...@tink.se on 2014-07-21 at 09:52 AM


One thing missing in Suppliers.html#memoize is to be able to invalidate the result. I propose the above solution also supports this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant