Consider automatic incoming entity collection to simplify API (discuss)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先检查公开的 HttpEntity.Strict 和 HttpEntity.Default API,以及 #460 中描述的行为。比较自动 strict 化、文档编写和隐藏流式处理内部细节这几种方案,尤其关注固定限制、延迟 dispatch,以及迁移到流式处理。issue 中没有定义 Done;贡献者首先需要做出设计决策并确定一致同意的范围。
由索引模型根据 Issue 内容生成。
描述
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
- 派生
- 56
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/pekko-http 的其他 Issue
-
dependencies
难度 1/5 1 小时以内 新手友好度 78/100
apache/pekko-http#1354 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 45/100
apache/pekko-http#1273 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
apache/pekko-http#1249 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
apache/pekko-http#1248 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
apache/pekko-http#1180 ·
维护者通常 1 天内回复
查看 apache/pekko-http 的全部 Issue
相似的 Issue
-
AI Auto-validate
难度 2/5 1-3 小时 新手友好度 76/100
ProjectSidewalk/SidewalkWebpage#5788 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
scalameta/metals-zed#99 ·
-
area:ops priority:P2 status:idea
难度 2/5 1-3 小时 新手友好度 78/100
KD5UJC-XYZ/scarab#112 ·
-
Bound wrong-magic P2P diagnostics to parsed header bytes可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
ergoplatform/ergo#2736 ·
维护者通常 1 天内回复
-
perf: use extend when buffering partition row indices in the native shuffle writer可能已有人在做 @HarshilMital 于 1 天前认领。 未关闭area:shuffle enhancement good first issue performance requires-triage
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-comet#7072 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复