[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Jetty HTTP client async mode
|
Hi,
On Thu, Jul 28, 2016 at 4:06 PM, Sergey Mashkov
<sergey.mashkov@xxxxxxxxxxxxx> wrote:
> Hi everyone
>
> I am experiencing difficulties with async jetty HTTP client api. I have a
> request, I setup async content listener like this
>
> request.onResponseContentAsync { response, buffer, callback ->
> // schedule some async task then call callback.success() on completed
> }
>
> It works but I am receiving next events before the callback get notified so
> I can't stop events.
Are you sure ?
That is exactly the meaning of the callback, to stop delivering events
until succeeded() (or failed()) is called.
> The only solution is to block inside the handler but it
> doesn't look like async at all. Is there way to suspend upcoming events
> until callback.success() called?
If it does not work it's a bug, but we have test cases that cover this.
Can you put up a reproducible test case that shows the issue ?
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.