Programmatically create a blocking task executor with a custom thread size
See original GitHub issueCurrently, the number of threads of a blocking task executor could be configured only by Flags.numCommonBlockingTaskThreads().
If a user who avoid using flags, he or she has to manually copy the factory code.
I think we can add a new builder method to ServerBuilder that takes the number of threads.
public ServerBuilder blockingTaskExecutor(int numThreads) {
return ...;
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Java ExecutorService that dynamically scale the number of ...
Create the ThreadPoolExecutor using a LinkedBlockingQueue and 20 as corePoolSize (first argument in the constructor):.
Read more >Task queuing in Executors.newFixedThreadPool() - Medium
Here we are creating a new instance of ThreadPoolExecutor with the same corePoolSize and maxPoolSize as the total number of threads which is...
Read more >CustomThreadPoolExecutor in Java Executor Framework
ThreadPool is a container in which contains some numbers of threads. These threads are given some tasks. · A blocking queue is a...
Read more >27. Task Execution and Scheduling - Spring
The Spring Framework provides abstractions for asynchronous execution and scheduling of tasks with the TaskExecutor and TaskScheduler interfaces, ...
Read more >Finally Getting the Most out of the Java Thread Pool - Stackify
Java Thread Pools · Executor – a simple interface for executing tasks · ExecutorService – a more complex interface which contains additional ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

One question I have is: do we really need a dedicated builder method in
ServerBuilder? Would it be better providing a utility class for this purpose, like we did inEventLoops?Sounds good to me all in all. How about introducing a builder API so we don’t have to have too many overloaded methods?