-
Notifications
You must be signed in to change notification settings - Fork 6
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
Simpler func for SimpleObjectPool #109
Conversation
Simpler func for SimpleObjectPool For the SimpleObjectPool constructor: - The constructor func can be `Func<T>`, we don't use the other param at all - the constructor func is IMHO a more important param than an initial size, so should come first - initial size has a default of zero
Timer test |
todo in a later PR:
|
@@ -8,16 +8,16 @@ namespace JustEat.StatsD | |||
/// </summary> | |||
public sealed class SimpleObjectPool<T> where T : class |
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.
We can make this internal
now too.
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.
Good point, done
And yes you're right, the generic is also redundant now too. |
I plan to make a later PR to fold I don't think that there are better options than this; as far as I know, there is no suitable generic pool class in the framework, and we are already doing something very close to this example |
Summarise the changes this Pull Request makes.
Simpler func for SimpleObjectPool
For the SimpleObjectPool constructor:
Func<T>
, we don't use the other param at allPlease include a reference to a GitHub issue if appropriate.