Hi,
I can pass a FutureCallback implementation to HttpAsyncClient.execute(…).
However the javadoc at 
https://hc.apache.org/httpcomponents-core-5.1.x/current/httpcore5/apidocs/org/apache/hc/core5/concurrent/FutureCallback.html
 is very sparse.
Particularly the following questions are not answered:

1) Is "completed(HttpResponse)" only called for success status codes or for all 
kinds server of responses? Would be good to mention that in 
https://hc.apache.org/httpcomponents-client-5.2.x/current/httpclient5/apidocs/org/apache/hc/client5/http/impl/async/CloseableHttpAsyncClient.html
 and other mentions of the execute method leveraging the parameter 
FutureCallback (because it seems to be specific to the FutureCallback being 
used from HttpAsyncClient.execute(…))

2) What (unchecked) exception to throw in the FutureCallback method for the 
future to fail with ExecutionException.html. Does it matter? Is there any 
recommendation, e.g. if the HTTP endpoint returned a 500 status? Maybe also the 
examples e.g. in 
https://github.com/apache/httpcomponents-client/blob/5.2.x/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttp1Pipelining.java
 could be extended in this regard.

Thanks in advance,
Konrad
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to