[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004049#comment-16004049
 ] 

yair ogen edited comment on HTTPCLIENT-1826 at 5/10/17 4:48 AM:
----------------------------------------------------------------

I wasn't sure if generating the request from the connection have no side 
affect. if it doesn't - I'll copy the code from the super "requestReady" method.

Please confirm.

Note: It's not just one line of code  and the below seems like redundant code 
to me that can easily break with newer version of apache client (not mention 
the additional synchronize that has its toll). I prefer my approach. You 
suggesting something like this:

            final HttpContext context = conn.getContext();
            synchronized (context) {
                final HttpAsyncClientExchangeHandler handler = 
(HttpAsyncClientExchangeHandler) conn.getContext().getAttribute(HTTP_HANDLER)
                if (handler != null && !handler.isDone()) {
                    org.apache.http.HttpRequest request = 
handler.generateRequest();
                    Header flowContext = request.getFirstHeader("FLOW_CONTEXT");
                    if (flowContext != null) {
                        
FlowContextFactory.deserializeNativeFlowContext(flowContext.getValue());
                    }
                }
            }                        
            super.requestReady(conn);


was (Author: yairogen):
I wasn't sure if generating the request from the connection have no side 
affect. if it doesn't - I'll copy the code from the super "requestReady" method.

Please confirm.

> Async Builder should include setting a ExecutorService
> ------------------------------------------------------
>
>                 Key: HTTPCLIENT-1826
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1826
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>            Reporter: yair ogen
>             Fix For: 5.0 Alpha3
>
>
> Currently you only expose setting ThreadFactory. Not very useful if a user 
> wants to send in a different thread pool altogether.
> We must have an option to pass in thread pools especially if we want this 
> async work to co-exist in the same pool as other tasks.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to