Skip to content

Commit 3004316

Browse files
author
Stephane Landelle
committed
Remove reaper thread from global config, Netty now uses a HashedWheelTimer, close AsyncHttpClient#331
1 parent 98eaba1 commit 3004316

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public class AsyncHttpClientConfig {
8888
protected boolean compressionEnabled;
8989
protected String userAgent;
9090
protected boolean allowPoolingConnection;
91-
protected ScheduledExecutorService reaper;
9291
protected ExecutorService applicationThreadPool;
9392
protected ProxyServerSelector proxyServerSelector;
9493
protected SSLContext sslContext;
@@ -179,7 +178,6 @@ private AsyncHttpClientConfig(int maxTotalConnections,
179178
this.ioExceptionFilters = ioExceptionFilters;
180179
this.requestCompressionLevel = requestCompressionLevel;
181180
this.maxRequestRetry = maxRequestRetry;
182-
this.reaper = reaper;
183181
this.allowSslConnectionPool = allowSslConnectionCaching;
184182
this.removeQueryParamOnRedirect = removeQueryParamOnRedirect;
185183
this.hostnameVerifier = hostnameVerifier;
@@ -196,15 +194,6 @@ private AsyncHttpClientConfig(int maxTotalConnections,
196194
this.asyncConnectMode = asyncConnectMode;
197195
}
198196

199-
/**
200-
* A {@link ScheduledExecutorService} used to expire idle connections.
201-
*
202-
* @return {@link ScheduledExecutorService}
203-
*/
204-
public ScheduledExecutorService reaper() {
205-
return reaper;
206-
}
207-
208197
/**
209198
* Return the maximum number of connections an {@link AsyncHttpClient} can handle.
210199
*
@@ -516,7 +505,7 @@ public boolean isValid() {
516505
// when using a ManagedExecutorService.
517506
// When this is the case, we assume it's running.
518507
}
519-
return (atpRunning && !reaper.isShutdown());
508+
return atpRunning;
520509
}
521510

522511
/**
@@ -1194,7 +1183,6 @@ public Builder(AsyncHttpClientConfig prototype) {
11941183
userAgent = prototype.getUserAgent();
11951184
redirectEnabled = prototype.isRedirectEnabled();
11961185
compressionEnabled = prototype.isCompressionEnabled();
1197-
reaper = prototype.reaper();
11981186
applicationThreadPool = prototype.executorService();
11991187

12001188
requestFilters.clear();

providers/netty/src/main/java/org/asynchttpclient/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public void close() {
6565
if (closed.compareAndSet(false, true)) {
6666
try {
6767
channels.close();
68-
config.reaper().shutdown();
6968
} catch (Throwable t) {
7069
LOGGER.warn("Unexpected error on close", t);
7170
}

0 commit comments

Comments
 (0)