[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Threading issue with AsyncListener.onTimeout
|
Hi,
On Wed, Oct 26, 2016 at 6:14 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
> onTimeout() merely notifies the application that the timeout expired.
> From there you can call AsyncContext.complete() directly, and the
> container will write the response headers asynchronously for you.
> Otherwise, you have to block writing the content (because you cannot
> return from onTimeout() without calling dispatch() or complete()).
Incidentally, this is why non-trivial applications don't use the
built-in timeout mechanism.
If the application times out and has to write a response content that
may block, the only option is to block.
With a custom timer, you can write asynchronously because you're not
restricted by having to call dispatch() or complete() from
onTimeout().
--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.