Question

when writing a CGI script or a basic servlet you can send part of the response to the client before the entire response has been generated. This is advantageous when, for example, performing a large SQL query and displaying the results in an HTML table. Showing the results as they come in makes the application much more responsive. Is this possible in a basic REST framework like Scalatra or Unfiltered--where the return value is often the response text?

No correct solution

OTHER TIPS

I think, that you talking about Chunked Transfer Encoding you need support for this encoding by servlet engine. AFAIK, Atmosphere with right backend may help you, you can try use it with scalatra. About Unfiltered, it has netty backend, I'm not sure, that chunked encoding currently supported by Unfiltered, but you can try to hack it.

P.S. You can look at example of streaming server in Unfiltered: https://github.com/n8han/All-Aboard.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top