On 4/28/07, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:

Hi,
>> The request, wait, async response + close pattern seems to be a
>> pretty common use case though, especially with server side push
>> (AJAX), so it would still be good to have a solution that works well
>> allways.
> Yes, and for this you don't need Comet, you need "Asynchronous
> Servlets" they are somewhat different, although you can achieve the
> same through
> A) Using a regular servlet, and just hold on to the worker thread
> B) Using a Comet servlet but with a short timeout.
>   In order for you to not timeout if your write is way delayed, then
> you need to write some bogus data before the timeout happens
>
> As of now, we don't have async servlets on the agenda, and we would
> need to see what it takes to make Comet to behave like it.
> Filip
>
Actually I  looked at Jetty's continuations before I looked at Tomcat's
Comet. That seems to be the async servlet model. The way it works is
that the server side application can "wake up" the request after which
the response must be done immediately. This comes down to the
application causing the "event" method to be called with a specific
event. Possibly this approach could be used in Tomcat's Comet as well.

The reasons I didn't go for Jetty's continuations are:
1) it really is only request + wait + response, specifically
a) it would not let me process input as it comes in
b) it would only let me write output once, after that the response must
be done


As far as I know for my tests Jetty works: request + wait + wait + wait ...
+ response. You can pause the process as many times as you want and
consequently write to the output as many times as you want. I guess probably
you can also read from the request many times (the continuation objects
offers you also the input stream), but I havenĀ“t tested that.

Cheers,
Martin

Reply via email to