[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] AsyncContentProvider under-documented
|
On 1/31/15 9:26 AM, Simone Bordet wrote:
Hi,
On Thu, Jan 29, 2015 at 7:11 AM, John Gardiner Myers
<jgmyers@xxxxxxxxxxxxxx> wrote:
I need to implement an AsyncContentProvider,
Why ?
Both existing implementations consume an arbitrary amount of memory if
the destination is slower than the producer of content. I need to limit
the production of content to not much more than what is being consumed.
I would also like the producer to be optionally asynchronous, so when it
is rate limited I would want it to later be notified when it should
start producing content again.
For cases where the producer can only produce the data once, I want to
be able to retry the request to a second server in case the connection
to a first server fails. To do that, I need to delay the production of
content until the ContentProvider.iterator() method is called. (I am
presuming Jetty client doesn't call that method until the connection
succeeds.)
The primary use case I have is to stream data in from Jetty server
through Jersey 2 and out through Jetty client.