Enhancement: Request at least N bytes of space in buffers

オープン
#103 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
julia

調査の方向性

まず codec の process 関数のコントラクトを読み、NoopStream の例を追って、入力および出力バッファーのサイズがどのように選択されるかを理解します。EOF の動作を含め、少なくとも N バイトを要求するために必要なセマンティクスを決定します。このコントラクトについて合意し、例で要求したバッファー領域を取得できれば作業は完了です。

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
Julia
スター
90
フォーク
26
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaIO/TranscodingStreams.jl のほかの issue

JuliaIO/TranscodingStreams.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。