handling 'Content-Encoding: chunked' in a lazy iterative manner

handling 'Content-Encoding: chunked' in a lazy iterative manner


Hi all,
I'm not even sure if this is possible with JavaScript at the moment,
but it would make a powerful feature if it were.
If returning a list of resources as the response to a request, it's
relatively trivial to configure the app (in Django at least) to flush
the stream after each resource and provide a semi real-time feed of
results, ie you don't have to wait for the last item to be calculated
before the first one is returned. This uses Content-Encoding chunked.
I was thinking that if jQuery could somehow recognise these types of
response, it could iterate over these individual resources as they
come over the wire, then the callback would be given individual items
rather than the full response. This would make AJAXy functionality
even more responsive because you can start handling parts of the
response before the server has even finished generating the later
parts.
Maybe this is already possible, but I couldn't have any documentation
or mention of it.
Any thoughts on this idea?
Regards,
Andrew Ingram