JuliaIO / TranscodingStreams.jl

Simple, consistent interfaces for any codec.
https://juliaio.github.io/TranscodingStreams.jl/
Other
85 stars 28 forks source link

BREAKING: `eof` errors if stream isn't readable #230

Closed nhz2 closed 2 months ago

nhz2 commented 2 months ago

If the eof function returns false then it must be safe to read a byte.

If the stream is closed or otherwise not readable eof should throw an error to distinguish this from the case where the stream is empty. Ref: https://github.com/JuliaIO/TranscodingStreams.jl/pull/170#discussion_r1501890682

To get something kindof similar to the previous behavior of eof use !isreadable(stream) || eof(stream)

nhz2 commented 2 months ago

After this and #229 is merged I'll make a PR to update the version to 0.11

mkitti commented 2 months ago

Please provide guidance on how to migrate with the breaking change or at least provide further documentation on the change.

nhz2 commented 2 months ago

Okay, I can add a section to the docs on how to update from 0.10 to 0.11. For most uses no changes should be needed.