Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Question regarding Continuation documentation

Hi,

On Wed, Nov 12, 2014 at 7:05 AM, Christoph Läubrich
<laeubi@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> yes I can setup the timeout later, but the documentation also states that
> suspend must be called before handing over the continuation to
> background/event worker.
> Of course I can start the work and try to set the Continuation later, but
> this would require some kind of carefull syncronization ...

Ah, right, if you submit the task before suspending, the task may
finish before the request is suspended, so no, it's not a viable
solution.

> I haven't tried yet, but is it then possible to re-suspend the Continuation
> after it has been resumed?

Yes, the cycle:

startAsync() -> dispatch() -> startAsync() -> dispatch() -> startAsync() -> ...

is something that is fully supported.

So that leaves you with the second approach, where your task knows it
cannot be handled and dispatches to another path to throttle the
client.

-- 
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