reta commented on code in PR #3725:
URL: https://github.com/apache/cxf/pull/3725#discussion_r4605223457
##########
rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitFactory.java:
##########
@@ -144,7 +143,8 @@ public PoolingAsyncClientConnectionManager
getConnectionManager() {
}
}
- private volatile Map<HTTPClientPolicy, AsyncClient> clients = new
ConcurrentHashMap<>();
+ // the clients of the conduits, to shut them down with the factory
+ private final Map<CloseableHttpAsyncClient, AsyncClient> clients = new
ConcurrentHashMap<>();
Review Comment:
> So the map is a registry of live clients, and its key lets release() find
the AsyncClient from what the conduit holds. We could drop the key by making
createClient() return AsyncClient and keeping a Set<AsyncClient>,
Thanks @ffang , I think we could keep a set `Set<AsyncClient>` but keep the
same signatures, since `AsyncClient` has reference to
`CloseableHttpAsyncClient`. We need it on `release()` only essentially:
```
final AsyncClient client = clients.remove(httpClient);
```
would become:
```
final AsyncClient client = clients.stream().findAny(s -> s.getClient() ==
httpClient);
```
Or I am missing something? Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]