Enhancement: Request at least N bytes of space in buffers
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- julia
- Domain
- backend-api-design, stream-processing
Research direction
Start by reading the codec process function contract and tracing the NoopStream example to understand how input and output buffer sizes are chosen. Determine the semantics needed for requesting at least N bytes, including EOF behavior; the work is done when that contract is agreed and the example can obtain the requested buffer space.
Written by the indexing model from the issue text.
Description
A new codec is implemented by extending the process function, which gives you a number of input bytes to transcode, and a number of bytes to write the result to. Right now, there is, as far as I can see, no way of requesting at least N bytes of input/output space. This makes it a little annoying to implement blocked codexes.
E.g. in the following example:
julia> open("/tmp/file", "w") do file
write(file, rand(UInt8, Int(1.5 * 1 << 17)))
end
196608
julia> stream = NoopStream(open("/tmp/file"); bufsize=1<<18)
TranscodingStream{Noop,IOStream}(<mode=idle>)
julia> read(stream, UInt8); bytesavailable(stream)
131071
Here, even though the stream has 2^18 bytes of buffer, and the file is 1.5*2^17, only 2^17 bytes is read into the buffer at a time.
What assumptions can we make about the number of available bytes? Could we, somehow, force the codec to make at least N bytes available, unless we read the EOF?
- Dominant language
- Julia
- Stars
- 90
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaIO/TranscodingStreams.jl
-
Allow generic `DenseVector{UInt8}` as input/outputPossibly taken @nhz2 claimed this 460 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
JuliaIO/TranscodingStreams.jl#247 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
JuliaIO/TranscodingStreams.jl#246 · 1 comment ·
-
Support libaec?Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
JuliaIO/TranscodingStreams.jl#207 · 2 comments ·
-
API for BufferOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaIO/TranscodingStreams.jl#202 · 2 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
JuliaIO/TranscodingStreams.jl#188 ·
All issues in JuliaIO/TranscodingStreams.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
question
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
brown-ccv/Chamber.jl#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAstro/SolarPosition.jl#143 ·
-
distributions
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaBayes/Wren.jl#404 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#113 ·
Maintainers usually reply within 1 day