Skip to content

Commit f723dc6

Browse files
waleed-dawoodslandelle
authored andcommitted
Thread factory provided by the client should be used if not null (AsyncHttpClient#1545)
* thread factory provided by the client should be used if not null, as being done in ChannelManager * Restoring the behavior for fallback, with "-timer" in the name.
1 parent fc7b750 commit f723dc6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public DefaultAsyncHttpClient(AsyncHttpClientConfig config) {
9292
}
9393

9494
private Timer newNettyTimer(AsyncHttpClientConfig config) {
95-
ThreadFactory threadFactory = new DefaultThreadFactory(config.getThreadPoolName() + "-timer");
95+
ThreadFactory threadFactory = config.getThreadFactory() != null ? config.getThreadFactory() : new DefaultThreadFactory(config.getThreadPoolName() + "-timer");
96+
9697
HashedWheelTimer timer = new HashedWheelTimer(threadFactory);
9798
timer.start();
9899
return timer;

0 commit comments

Comments
 (0)