Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Fwd: continuation.complete() method query

Hi,

On Thu, Jun 11, 2020 at 6:39 AM Gurudatta Pai <gurudatta.pai07@xxxxxxxxx> wrote:
>
> Hi All,
>
> I am using suspend/complete model for processing a request. continuation.suspend() is called once the request is dispatched asynchronously and continuation.complete() is called on response.
>
> I tried registering a listener with the continuation and onCompletion is called once the complete is executed. The response is written as part of onCompletion and we see that the response is written to the client properly.
>
> We see below description for onComplete.
>
>  Called when a continuation life cycle is complete and after any calls to ServletRequestListener.requestDestroyed(javax.servlet.ServletRequestEvent) The response may still be written to during the call.
>
> https://www.eclipse.org/jetty/javadoc/current/org/eclipse/jetty/continuation/ContinuationListener.html
>
> Can we use onComplete method to write the response to client or will it have any race condition that may lead to response not getting written to client?
>
> Please advice.

Jetty Continuations have been discontinued, replaced by the standard
Servlet 3.0 APIs for asynchronous request/response processing.

You should update your code to use the standard Servlet 3.0 APIs.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top