Skip to content

core: allow application to provide all threads - inprocess channel#4139

Merged
dapengzhang0 merged 2 commits intogrpc:masterfrom
dapengzhang0:provideallthreads1
Feb 27, 2018
Merged

core: allow application to provide all threads - inprocess channel#4139
dapengzhang0 merged 2 commits intogrpc:masterfrom
dapengzhang0:provideallthreads1

Conversation

@dapengzhang0
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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