Skip to content

Commit df33a36

Browse files
committed
Remove dead reaper
1 parent a647686 commit df33a36

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/main/java/com/ning/http/client/AsyncHttpClientConfig.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.util.List;
3131
import java.util.concurrent.ExecutorService;
3232
import java.util.concurrent.Executors;
33-
import java.util.concurrent.ScheduledExecutorService;
3433
import java.util.concurrent.ThreadFactory;
3534

3635
/**
@@ -103,7 +102,6 @@ private AsyncHttpClientConfig(int maxTotalConnections,
103102
boolean compressionEnabled,
104103
String userAgent,
105104
boolean keepAlive,
106-
ScheduledExecutorService reaper,
107105
ExecutorService applicationThreadPool,
108106
ProxyServerSelector proxyServerSelector,
109107
SSLContext sslContext,
@@ -543,7 +541,6 @@ public static class Builder {
543541
private boolean useProxySelector = Boolean.getBoolean(ASYNC_CLIENT + "useProxySelector");
544542
private boolean allowPoolingConnection = true;
545543
private boolean useRelativeURIsWithSSLProxies = Boolean.getBoolean(ASYNC_CLIENT + "useRelativeURIsWithSSLProxies");
546-
private ScheduledExecutorService reaper;
547544
private ExecutorService applicationThreadPool;
548545
private ProxyServerSelector proxyServerSelector = null;
549546
private SSLContext sslContext;
@@ -716,17 +713,6 @@ public Builder setKeepAlive(boolean allowPoolingConnection) {
716713
return this;
717714
}
718715

719-
/**
720-
* Set the{@link ScheduledExecutorService} used to expire idle connections.
721-
*
722-
* @param reaper the{@link ScheduledExecutorService} used to expire idle connections.
723-
* @return a {@link Builder}
724-
*/
725-
public Builder setScheduledExecutorService(ScheduledExecutorService reaper) {
726-
this.reaper = reaper;
727-
return this;
728-
}
729-
730716
/**
731717
* Set the {@link java.util.concurrent.ExecutorService} an {@link AsyncHttpClient} use for handling
732718
* asynchronous response.
@@ -1107,18 +1093,6 @@ public Builder(AsyncHttpClientConfig prototype) {
11071093
* @return an {@link AsyncHttpClientConfig}
11081094
*/
11091095
public AsyncHttpClientConfig build() {
1110-
1111-
if (reaper == null) {
1112-
reaper = Executors.newScheduledThreadPool(Runtime.getRuntime()
1113-
.availableProcessors(), new ThreadFactory() {
1114-
public Thread newThread(Runnable r) {
1115-
Thread t = new Thread(r, "AsyncHttpClient-Reaper");
1116-
t.setDaemon(true);
1117-
return t;
1118-
}
1119-
});
1120-
}
1121-
11221096
if (applicationThreadPool == null) {
11231097
applicationThreadPool = Executors
11241098
.newCachedThreadPool(new ThreadFactory() {
@@ -1156,7 +1130,6 @@ public Thread newThread(Runnable r) {
11561130
compressionEnabled,
11571131
userAgent,
11581132
allowPoolingConnection,
1159-
reaper,
11601133
applicationThreadPool,
11611134
proxyServerSelector,
11621135
sslContext,

0 commit comments

Comments
 (0)