|
30 | 30 | import java.util.List;
|
31 | 31 | import java.util.concurrent.ExecutorService;
|
32 | 32 | import java.util.concurrent.Executors;
|
33 |
| -import java.util.concurrent.ScheduledExecutorService; |
34 | 33 | import java.util.concurrent.ThreadFactory;
|
35 | 34 |
|
36 | 35 | /**
|
@@ -103,7 +102,6 @@ private AsyncHttpClientConfig(int maxTotalConnections,
|
103 | 102 | boolean compressionEnabled,
|
104 | 103 | String userAgent,
|
105 | 104 | boolean keepAlive,
|
106 |
| - ScheduledExecutorService reaper, |
107 | 105 | ExecutorService applicationThreadPool,
|
108 | 106 | ProxyServerSelector proxyServerSelector,
|
109 | 107 | SSLContext sslContext,
|
@@ -543,7 +541,6 @@ public static class Builder {
|
543 | 541 | private boolean useProxySelector = Boolean.getBoolean(ASYNC_CLIENT + "useProxySelector");
|
544 | 542 | private boolean allowPoolingConnection = true;
|
545 | 543 | private boolean useRelativeURIsWithSSLProxies = Boolean.getBoolean(ASYNC_CLIENT + "useRelativeURIsWithSSLProxies");
|
546 |
| - private ScheduledExecutorService reaper; |
547 | 544 | private ExecutorService applicationThreadPool;
|
548 | 545 | private ProxyServerSelector proxyServerSelector = null;
|
549 | 546 | private SSLContext sslContext;
|
@@ -716,17 +713,6 @@ public Builder setKeepAlive(boolean allowPoolingConnection) {
|
716 | 713 | return this;
|
717 | 714 | }
|
718 | 715 |
|
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 |
| - |
730 | 716 | /**
|
731 | 717 | * Set the {@link java.util.concurrent.ExecutorService} an {@link AsyncHttpClient} use for handling
|
732 | 718 | * asynchronous response.
|
@@ -1107,18 +1093,6 @@ public Builder(AsyncHttpClientConfig prototype) {
|
1107 | 1093 | * @return an {@link AsyncHttpClientConfig}
|
1108 | 1094 | */
|
1109 | 1095 | 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 |
| - |
1122 | 1096 | if (applicationThreadPool == null) {
|
1123 | 1097 | applicationThreadPool = Executors
|
1124 | 1098 | .newCachedThreadPool(new ThreadFactory() {
|
@@ -1156,7 +1130,6 @@ public Thread newThread(Runnable r) {
|
1156 | 1130 | compressionEnabled,
|
1157 | 1131 | userAgent,
|
1158 | 1132 | allowPoolingConnection,
|
1159 |
| - reaper, |
1160 | 1133 | applicationThreadPool,
|
1161 | 1134 | proxyServerSelector,
|
1162 | 1135 | sslContext,
|
|
0 commit comments