Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] problem with continuation reuse - how to sync timeout with async task?

Hi,

On Mon, Nov 3, 2014 at 6:43 PM, Christoph Läubrich
<laeubi@xxxxxxxxxxxxxx> wrote:
> Thanks for your response. This would mean I had to keep track of all
> background task and make some kind of syncronization between the servlet and
> the background task what is something I would avoid!

This behavior is actually referenced in the Servlet specification, see
Section 3.12 of the Servlet 3.1 specification.
While it mentions request objects, I think it can be implied that
other request-related object such as the async context may be recycled
as well and as such the developers should be aware that using them
outside their lifetime may produce undefined results.

> Would it then be safe to acces the state of a Continuation from different
> threads while in the web-cycle?

Yes.

I recommend, however, that you upgrade to Jetty 9, and use the
standard Servlet API rather than Continutions.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top