I changed a little in my code:
final AtomicLong writeResponseTime= new AtomicLong(0);
final long timeout = 3;
final AsyncContext async = req.startAsync();
async.setTimeout(timeout);
async.addListener(new AsyncListener(){
@Override
On 24/05/2013 10:27, jie tang wrote:
> But it means that even if I write some content to response, the onTimeout
> method is still called
Correct. The timeout starts when the AsyncContext is started and is
reset every time data is written to the response. Exactly the same way
socket timeouts work.
But it means that even if I write some content to response, the onTimeout
method is still called
2013/5/24 Mark Thomas
> On 24/05/2013 10:15, jie tang wrote:
> > I tried the following code:
> > final AsyncContext async = req.startAsync();
> > async.setTimeout(3);
> >
> >
On 24/05/2013 10:15, jie tang wrote:
> I tried the following code:
> final AsyncContext async = req.startAsync();
> async.setTimeout(3);
>
> async.addListener(new AsyncListener(){
>
> @Override
> public void onComplete(AsyncEvent event) throws I
I tried the following code:
final AsyncContext async = req.startAsync();
async.setTimeout(3);
async.addListener(new AsyncListener(){
@Override
public void onComplete(AsyncEvent event) throws IOException {
System.out.println(Threa
Thank you very much
2013/5/24 Mark Thomas
> On 24/05/2013 09:23, jie tang wrote:
> > So if I use AsyncContext.start to run a Runnable. When that Runnable does
> > some work but not write to response, will AsyncListener.onTimeout be
> > invoked?
>
> Yes, unless you set the timeout to zero or les
On 24/05/2013 09:23, jie tang wrote:
> So if I use AsyncContext.start to run a Runnable. When that Runnable does
> some work but not write to response, will AsyncListener.onTimeout be
> invoked?
Yes, unless you set the timeout to zero or less (no timeout).
The default value is 30 seconds.
Mark
So if I use AsyncContext.start to run a Runnable. When that Runnable does
some work but not write to response, will AsyncListener.onTimeout be
invoked?
2013/5/24 Mark Thomas
> On 24/05/2013 09:16, jie tang wrote:
> > Thanks.
> >
> > So the only way to avoid the invocation of AsyncListener.onTim
On 24/05/2013 09:16, jie tang wrote:
> Thanks.
>
> So the only way to avoid the invocation of AsyncListener.onTimeout is that
> we invoke AsyncContext.complete or AsyncContext.dispatch?
Or write some content to the response.
Mark
>
>
> 2013/5/24 Mark Thomas
>
>> On 24/05/2013 09:05, jie tan
Thanks.
So the only way to avoid the invocation of AsyncListener.onTimeout is that
we invoke AsyncContext.complete or AsyncContext.dispatch?
2013/5/24 Mark Thomas
> On 24/05/2013 09:05, jie tang wrote:
> > Hi,
> >
> > I don't understand the meaning of timeout of an asynchronous operation.
> >
On 24/05/2013 09:05, jie tang wrote:
> Hi,
>
> I don't understand the meaning of timeout of an asynchronous operation.
> Servlet 3.0 says "The time out applies to the AsyncContext once the
> container-initiated dispatch during which one of the
> ServletRequest.startAsync methods was called has ret
Hi,
I don't understand the meaning of timeout of an asynchronous operation.
Servlet 3.0 says "The time out applies to the AsyncContext once the
container-initiated dispatch during which one of the
ServletRequest.startAsync methods was called has returned to the container."
But when is the completi
12 matches
Mail list logo