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 open for composed transcodingstreams #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jakobnissen
Copy link
Collaborator

This allows users to easily chain codecs using the do-syntax. Here is an example where the input is chained through four different streams.

julia> using CodecZlib, TranscodingStreams

julia> open(
           i -> first(read(i, String), 10),
           GzipDecompressorStream ∘ NoopStream ∘ GzipCompressorStream ∘ NoopStream,
           "Project.toml"
       )
"name = \"Tr"

@jakobnissen
Copy link
Collaborator Author

I'll add tests if anyone with the permission to merge gives me the thumbs-up :)

@mkitti mkitti self-requested a review August 23, 2022 15:45
Comment on lines +208 to +210
function _open(code::Type{<:Type{T}}, io::IO) where {T <: TranscodingStream}
T(io)
end
Copy link
Member

@mkitti mkitti Aug 23, 2022

Choose a reason for hiding this comment

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

Could you add a comment about what this does?

Copy link
Member

@mkitti mkitti left a comment

Choose a reason for hiding this comment

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

Please add tests

@ViralBShah
Copy link
Contributor

@jakobnissen If helpful and if you are interested, I can give you commit access here.

@mkitti
Copy link
Member

mkitti commented Aug 18, 2023

This still needs a test.

@ViralBShah
Copy link
Contributor

This still needs a test.

Agree.

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.

3 participants