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

Enable streaming file output #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julik
Copy link

@julik julik commented Jul 14, 2019

This replaces Rubyzip with ZipTricks, and adds render_to on the Document class. render_to will write to any IO object without needing it to be rewindable or seekable.

This permits output to a socket or to a streaming web response, and allows memory savings when the output is large. The deflated writer in ZipTricks also regularly flushes the written bytes, making sure that not too many string buffers get accumulated.

⚠️ Note that ZipTricks uses keyword arguments, so this will effectively make Caracal require Ruby 2.1+

This replaces Rubyzip with ZipTricks,
and adds `render_to` on the Document
class. `render_to` will write to any
IO object without needing it to be
rewindable or seekable.

This permits output to a socket
or to a streaming web response,
and allows memory savings when the output
is large. The deflated writer in ZipTricks
also regularly flushes the written bytes,
making sure that not too many string buffers
get accumulated.
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.

1 participant