async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

should config.getThreadFactory take a pool name or suffix?

Open dsilvasc opened this issue 5 years ago • 3 comments

Both DefaultAsyncHttpClient and ChannelManager call config.getThreadFactory, but when the result is null, DefaultAsyncHttpClient instantiates a DefaultThreadFactory with the pool name config.getThreadPoolName() + "-timer" while ChannelManager instantiates that same factory with the pool name config.getThreadPoolName().

This means that when you don't set a thread factory in the client config, you'll end up with two different pool names, but if you do set a thread factory in the client config, you'll end up with the same pool name for both use cases.

Should getThreadFactory take a pool name (or even just a suffix) to allow differentiating its use cases in DefaultAsyncHttpClient and ChannelManager?

dsilvasc avatar Oct 06 '18 04:10 dsilvasc

There's value in naming the (single) timer thread differently so it can be told appart from the IO threads. AFAIK, the only way to achieve the same thing would be to have 2 different ThreadFactories. Contributions welcome.

slandelle avatar Oct 16 '18 15:10 slandelle

Hi @slandelle, is it still actual? I would like to take it.

mchernyakov avatar Jan 01 '20 23:01 mchernyakov

Hi @mchernyakov Yes, feature request is still open, please feel free to contribute.

slandelle avatar Jan 02 '20 08:01 slandelle