Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream all JSON responses [ci drivers] #6623

Merged
merged 1 commit into from
Jan 2, 2018
Merged

Conversation

senior
Copy link
Contributor

@senior senior commented Dec 28, 2017

This commit switches from ring.middleware.json/wrap-json-response to
a new function that will stream JSON responses. Before this change the
full JSON response was serialized to a String first, then written to
the response stream. This change will skip that step and write the
response to a PipedOutputStream directly.

This is the same approach that was used in the response for the
/database/:id/fields route, just generalized and applied to all
routes.

This commit switches from `ring.middleware.json/wrap-json-response` to
a new function that will stream JSON responses. Before this change the
full JSON response was serialized to a String first, then written to
the response stream. This change will skip that step and write the
response to a PipedOutputStream directly.

This is the same approach that was used in the response for the
`/database/:id/fields` route, just generalized and applied to all
routes.
Copy link
Member

@camsaul camsaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@camsaul camsaul added this to the 0.28 milestone Jan 2, 2018
@senior senior merged commit 36c79d1 into master Jan 2, 2018
@senior senior deleted the stream-json-responses branch January 2, 2018 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants