[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    [jira] [Created] (HTTPCLIENT-1943) Support for truly asynchronous request streaming
From:       "Ryan Schmitt (JIRA)" <jira () apache ! org>
Date:       2018-08-17 0:33:00
Message-ID: JIRA.13179482.1534465950000.99474.1534465980369 () Atlassian ! JIRA
[Download RAW message or body]

Ryan Schmitt created HTTPCLIENT-1943:
----------------------------------------

             Summary: Support for truly asynchronous request streaming
                 Key: HTTPCLIENT-1943
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1943
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: HttpClient (async)
    Affects Versions: 5.0 Beta1
            Reporter: Ryan Schmitt


I've been trying to figure out how to send asynchronous streaming requests =
in a way that would be compatible with the reactive streams spec. In the re=
active streaming model, the producer pushes data to the consumer; the consu=
mer does not need to poll for it (although it does need to signal its capac=
ity for more data so that the producer does not overwhelm it). I haven't be=
en able to figure out how to do this.

The closest I've come is by subclassing AbstractBinAsyncEntityProducer and =
implementing the=C2=A0produceData method. The problem with this approach is=
 that the Apache client seems to poll this method constantly (essentially b=
usy-waiting) until either channel.endStream() is called or an exception is =
thrown. In order for this to work, I need a way to either push data directl=
y to the StreamChannel or signal to the client that more data is available =
without having it ask me.

Another thing I noticed is that if I implement the=C2=A0available() method =
to return 0, the client stops polling and doesn't start again; it basically=
 stalls the request. It's occurred to me that I might be able to capture th=
e DataStreamChannel (via=C2=A0AsyncEntityProducer#produce) and push data in=
to it from a producer. I'll keep investigating, but it's mostly guesswork a=
t this point, since much of the 5.0 client is not yet documented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic