Stream type enhancements: finalization
まだ誰も着手していません。
評価
調査の方向性
Read the stream type definitions and the existing finalization support in the fold type, which the issue identifies as a precedent. Trace how take, terminating folds, and parRepeatM behave when a stream is not fully consumed. Done means defining and integrating stream finalization so early termination cleans up held resources, with tests covering those cases.
索引モデルが issue の本文から書いたものです。
説明
We use the bracket combinator to allocate a resource and use it inside the stream. When the stream stops or if an exception occurs the resource if freed automatically. However, if the stream is not fully consumed (e.g. if a fold terminates before the stream stops) then there is no way to cleanup any resources held by the stream other than GC. The only ways to do that is to either (1) drain the stream fully, or (2) let the GC clean it up.
Not sure if this is an important requirement but it can be solved by having a finalization function in the stream type just like we added one in the fold type. This will complicate all stream definitions though, just like it did in folds.
A stream would remain unconsumed on when take is used on it or a terminating fold is used on it which terminates before the stream terminates. If we use parRepeatM to generate a stream and then take just 1 element, the worker threads may still continue working until the stream is garbage collected, this could be problematic.
See also #585 for another stream type enhancement use case.
- 主要言語
- Haskell
- スター
- 926
- フォーク
- 71
- 平均マージ
- 6時間 49分
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
composewell/streamly のほかの issue
-
takeInterval yields nothing, dropInterval drops nothing対応中かも @GuillaumedeVolpiano が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
composewell/streamly#3271 ·
-
Parser: many accepts input that ends inside an element対応中かも @GuillaumedeVolpiano が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
composewell/streamly#3270 ·
-
aspect:api
難易度 4/5 1〜2日 初心者へのやさしさ 48/100
composewell/streamly#3206 ·
-
api:breaking aspect:api aspect:filesystem
難易度 4/5 1〜2日 初心者へのやさしさ 35/100
composewell/streamly#3203 ·
-
type:performance
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
composewell/streamly#3200 · コメント 2 件 ·
composewell/streamly の issue をすべて見る
似ている issue
-
bug desktop
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
simplex-chat/simplex-chat#8291 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: C# programs with top-level statements fail to compile対応中かも @AsyncNigam が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
compiler-explorer/compiler-explorer#9625 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs triage type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
reflex-0.10オープン
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
commercialhaskell/stackage#8180 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenZeppelin/canton-contracts#140 ·
メンテナーはふだん 1 日以内に返信