GS Cache: Stream multiple responses content as JSON

When extract files, we stream the result content in JSON. There's no
problem when files number is limited. However, when extracting many
files, say > 700, we have to split the requests into sub-requests. We
have to consolidate all response together and stream all of them into
*one* JSON stream.

This change refactor the old iter_content_as_json function to a class
which add queue the response multiple times. Finally, we call `stream`
to stream all responses in JSON.

TEST=Ran unit tests.

Change-Id: Ib1ab2f7ed2437c5c5f62412e2b9e92e18af413a3
Commit-Ready: Congbin Guo <>
Tested-by: Congbin Guo <>
Reviewed-by: Congbin Guo <>
2 files changed