Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Consider automatic incoming entity collection to simplify API (discuss)

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

まず、HttpEntity.Strict と HttpEntity.Default の公開 API、および #460 に記載された動作を調査します。自動 strict 化、ドキュメント、ストリーミング内部の非表示について比較し、固定された制限、遅延ディスパッチ、ストリーミングへの移行に特に注意を払います。issue では Done は定義されていません。コントリビューターは、まず設計上の決定を行い、合意されたスコープを定める必要があります。

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

説明

enhancement

One of the oldest issues with akka-http/pekko-http is the distinction between HttpEntity.Strict and HttpEntity.Default that cannot be observed on the wire but leads to different API behavior for the user just based on the timing with which data is received.

Strict contains an in-memory copy of the full data, while Default contains a live stream that is still connected to the connection.

The rationale for this API is that we want to supply a streaming API whenever it makes sense to 1. provide data to the user in real time as it comes in and 2. to avoid having to load all data into memory but have all the nice properties of streams like end-to-end backpressure and limited memory usage.

The backside is that while the current solution gives you all the options to deal with a real time situation optimally, it also requires you to deal with all these cases (or use toStrict in more cases).

However, this often trips up users (like in #460) where depending on the environment the exact same request can lead to different runtime behavior. Often, when running tests locally, it is much more likely that requests end up as Strict while in production, Default becomes more likely. In situations like #460, the effect can be really subtle and hard to understand.

One potential solution could be to auto-strictify incoming entities for simplicity. In that case, we would always read incoming entities to their completion (up to a fixed limit) and delay dispatching the incoming HTTP message until the full message is there. The benefit would be that users of simple applications would get every message with a strict entity.

The downside is that I can see no gradual migration path once you need streaming behavior for certain entities. Then you would still have to enable streaming for the whole application which then might not be expecting streaming entities...

Alternatives:

  • (even) better documentation to educate about the way things work
  • try to remove Strict from the public API (very intrusive and subtle issues like #460 will not be solved that way)
  • improve library to mitigate impact / hide internals of the streaming API further

(I have not convinced myself yet that we can or should change something right now without making other cases worse but still wanted to keep a note here)

主要言語
Scala
スター
196
フォーク
57
平均マージ
1日 18時間
マージ済み PR(30日)
43

環境構築

はじめの一歩

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

apache/pekko-http のほかの issue

apache/pekko-http の issue をすべて見る

似ている issue

Scala の issue をもっと見る

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

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