Repository navigation
Hide Recycler implemention to allow experimenting with different impl… - #9715
Merged
Merged
Conversation
…ementions of an Object pool Motivation: At the moment we directly extend the Recycler base class in our code which makes it hard to experiment with different Object pool implementation. It would be nice to be able to switch from one to another by using a system property in the future. This would also allow to more easily test things like #8052. Modifications: - Introduce ObjectPool class with static method that we now use internally to obtain an ObjectPool implementation. - Wrap the Recycler into an ObjectPool and return it for now Result: Preparation for different ObjectPool implementations
normanmaurer
requested review from
carl-mastrangelo,
ejona86,
njhill and
trustin
October 25, 2019 15:59
normanmaurer
commented
Oct 25, 2019
| public static <T> ObjectPool<T> newPool(final ObjectCreator<T> creator) { | ||
| ObjectUtil.checkNotNull(creator, "creator"); | ||
|
|
||
| return new RecyclerObjectPool<T>(creator); |
Member
Author
There was a problem hiding this comment.
We will add more implementations here then which will be selected based on a system property.
ejona86
approved these changes
Oct 25, 2019
Member
Author
|
@netty-bot test this please |
normanmaurer
added a commit
that referenced
this pull request
Oct 26, 2019
…ementions of an Object pool (#9715) Motivation: At the moment we directly extend the Recycler base class in our code which makes it hard to experiment with different Object pool implementation. It would be nice to be able to switch from one to another by using a system property in the future. This would also allow to more easily test things like #8052. Modifications: - Introduce ObjectPool class with static method that we now use internally to obtain an ObjectPool implementation. - Wrap the Recycler into an ObjectPool and return it for now Result: Preparation for different ObjectPool implementations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ementions of an Object pool
Motivation:
At the moment we directly extend the Recycler base class in our code which makes it hard to experiment with different Object pool implementation. It would be nice to be able to switch from one to another by using a system property in the future. This would also allow to more easily test things like #8052.
Modifications:
Result:
Preparation for different ObjectPool implementations