question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programmatically create a blocking task executor with a custom thread size

See original GitHub issue

Currently, 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
trustincommented, Feb 3, 2021

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 in EventLoops?

0reactions
trustincommented, Mar 7, 2021

Sounds good to me all in all. How about introducing a builder API so we don’t have to have too many overloaded methods?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found