[
https://issues.apache.org/jira/browse/HTTPCLIENT-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541305#comment-16541305
]
ASF subversion and git services commented on HTTPCLIENT-1928:
-------------------------------------------------------------
Commit 0c0e9c7b7cd9261e8155beac13446b526df36d6b in httpcomponents-client's
branch refs/heads/master from xiaohu-zhang
[ https://git-wip-us.apache.org/repos/asf?p=httpcomponents-client.git;h=0c0e9c7
]
HTTPCLIENT-1928: FutureCallback implementation that catches and logs exceptions
thrown in #completed method
> HttpAsyncClient callback should ignore exception throwed by compelete method
> ----------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1928
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1928
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Reporter: silver9886
> Priority: Major
>
> If exception throwed by completed method in FutureCallback argument in
> HttpAsyncClient.execute,the connection will be closed.
> but the exception throwed by customer code,should not affect the connection
> managed by the framework,the connection should be connected also.
> there can be a class called FutureCallbackIgnorecompelteExcepton class.
> public abstract class FutureCallbackIgnorecompelteExcepton <T> {
> private FutureCallback<T> t;
> void completed(T result){
> try{
> t.completed(result);
> }catch(Exception e)
> //ignore
> }
> void failed(Exception ex);
> void cancelled();
> }
> HttpAsyncClient changed as:
> HttpAsyncClient.<T> Future<T> execute(
> AsyncRequestProducer requestProducer,
> AsyncResponseConsumer<T> responseConsumer,
> HttpContext context,
> FutureCallbackIgnorecompelteExcepton <T> callback);
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]