-
Notifications
You must be signed in to change notification settings - Fork 3.9k
core: allow application to provide all threads - inprocess channel #4139
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
Conversation
return new InProcessServer(name, GrpcUtil.TIMER_SERVICE, streamTracerFactories); | ||
ObjectPool<ScheduledExecutorService> schedulerPool = | ||
scheduledExecutorService == null | ||
? SharedResourcePool.forResource(GrpcUtil.TIMER_SERVICE) |
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.
Use a ObjectPool field instead of ScheduledExecutorService and make this the default value. Then in the scheduledExecutorService()
method overwrite it with the FixedObjectPool.
You could do this pattern in InProcessChannelBuilder as well.
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.
Fixed. The pattern does not provide much gain for InProcessChannelBuilder, and currently it's in the same pattern as NettyChannelBuilder and OkHttpChannelBuilder.
@@ -55,13 +52,6 @@ static InProcessServer findServer(String name) { | |||
*/ |
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.
You need to update schedulerPool's documentation.
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.
Fixed
The is one of a sequence of PRs to allow application to provide all threads.
This PR added
InProcess{Channel, Server}Builder.scheduledExecutorService()
API