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

Add Crystal.print_buffered(io) and Crystal.print_error_buffered #15343

Merged

Conversation

ysbaddaden
Copy link
Contributor

Writes a message to a growable, in-memory buffer, before writing to a standard IO (e.g. STDERR) in a single write (possibly atomic, depending on PIPE_BUF) instead of having many individual writes to the IO which will be intermingled with other writes and be completely unintelligible.

Abstracted from the "unhandled exception in spawn" rescue. We might be able leverage this in some other places. This will at least be used for #15342.

Writes a message to a growable, in-memory buffer, before writing to a
standard IO (e.g. STDERR) in a single write (possibly atomic, depending
on PIPE_BUF) instead of having many individual writes to the IO which
will be intermingled with other writes and be completely unintelligible.
@straight-shoota straight-shoota added this to the 1.16.0 milestone Jan 14, 2025
@straight-shoota straight-shoota changed the title Add Crystal.print_buffered(io) and Crystal.print_error_buffered Add Crystal.print_buffered(io) and Crystal.print_error_buffered Jan 14, 2025
@straight-shoota straight-shoota merged commit 7135b1d into crystal-lang:master Jan 15, 2025
70 checks passed
@ysbaddaden ysbaddaden deleted the feature/crystal-print-buffered branch January 15, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants