Skip to content

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

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:feature/crystal-print-buffered
Jan 15, 2025
Merged

Add Crystal.print_buffered(io) and Crystal.print_error_buffered#15343
straight-shoota merged 1 commit intocrystal-lang:masterfrom
ysbaddaden:feature/crystal-print-buffered

Conversation

@ysbaddaden
Copy link
Collaborator

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