Skip to content

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

Merged
merged 2 commits into from
Feb 27, 2018

Conversation

dapengzhang0
Copy link
Member

@dapengzhang0 dapengzhang0 commented Feb 26, 2018

The is one of a sequence of PRs to allow application to provide all threads.
This PR added InProcess{Channel, Server}Builder.scheduledExecutorService() API

return new InProcessServer(name, GrpcUtil.TIMER_SERVICE, streamTracerFactories);
ObjectPool<ScheduledExecutorService> schedulerPool =
scheduledExecutorService == null
? SharedResourcePool.forResource(GrpcUtil.TIMER_SERVICE)
Copy link
Member

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.

Copy link
Member Author

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) {
*/
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@dapengzhang0 dapengzhang0 merged commit 39decad into grpc:master Feb 27, 2018
@dapengzhang0 dapengzhang0 deleted the provideallthreads1 branch May 2, 2018 17:18
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants