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

Oleg Kalnichevski commented on HTTPCLIENT-2334:
-----------------------------------------------

[~a701440] What output does `#available` of your 
`{color:#000000}AsyncDataProducer` implementation produce? If a data producer 
is unable to produce more data momentarily it should return 0 from `#available` 
to suspend output readiness events.
{color}

{color:#000000}Oleg{color}

> AsyncDataProducer.produce gets into a tight loop
> ------------------------------------------------
>
>                 Key: HTTPCLIENT-2334
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2334
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient (async)
>    Affects Versions: 5.2.2
>            Reporter: Alex
>            Priority: Major
>
> I am using async data transfer for http request (POST) and using 
> AsyncDataProducer interface produce method. This method seems to be called 
> multiple times in a tight NIO loop when it does not immediately produce data 
> when called. In my case it needs to store the provided DataStreamChannel and 
> return, so that DataStreamChannel can be used later when data for the request 
> is available. However the method seems to be called again immediately in a 
> tight loop and is causing high CPU consumption. Effectively I had to make it 
> blocking which is not the intent of the API.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to