Interesting way to do it.   However, it ONLY will work if either:

1) Chunking it being used for  the reponse
or
2) Keep-Alives are turned off.

Also, I don't think that would work through many proxy servers as many of them 
buffer the whole response at once.

As far as CXF goes, you could probably do it, but it would require quite a bit 
of work to setup.   You would probably need to put an interceptor on the out 
chain that sits right before the interceptor that marshalls that data.  
(Usually BareOutInterceptor) that would sit there writing the commend to the 
XmlStreamWriter and flushing it (which I would have to double check to see if 
that flushes all the streams as well, it might not) until it somehow gets a 
signal from the other code that the data object is ready.  

Definitely tricky, and like I said, really is limitted.   If a client doesn't 
send it's request chunked, Jetty may not chunk the response.  If keep alives 
are on, it would buffer the whole thing and you'd be suck anyway.    Not sure 
what tomcat would do.

Dan



On Friday 10 October 2008 9:16:17 am Andrew Clegg wrote:
> Afternoon all,
>
> I've just seen some interesting behaviour from a web service provided
> by some of my collaborators in Switzerland -- don't know what stack
> (or even language) they use. Their service does some pretty intensive
> data analysis and can accept quite big queries. It starts by sending
> the HTTP response headers, and then while it's chugging away on the
> actual query, sends:
>
> <!-- processing -->
>
> every few seconds until the actual results are ready to send.
>
> This seems like quite a good way to avoid timeouts. Can CXF do anything
> similar?
>
> Cheers,
>
> Andrew.



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog

Reply via email to