Feature Proposal: report progress writing to sockets
维护者通常 3 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- scala
- 领域
- networking
调研方向
Start by reading the Stream trait and locating the fs2 socket implementations that write incrementally. Review how default implementations can preserve bincompat and where each subclass would need an override; the work is done when socket writes report incremental progress through both proposed APIs.
由索引模型根据 Issue 内容生成。
描述
https://github.com/http4s/http4s/issues/7824 reports that spurious http4s timeouts occur writing very large chunks to a socket. The fs2 socket implementations (all?) actually write to the socket incrementally, but do not provide any indication to the caller that they are making progress.
This could take the form of two new methods on the Stream trait:
/** Writes `bytes` to the peer, reporting as bytes are written.
*
* Completes when the bytes are written to the socket.
*/
def writeProgress(bytes: Chunk[Byte]): Stream[F, Int] =
Stream.eval(write(bytes)) >> Stream(bytes.size)
/** Writes the supplied stream of bytes to this socket via `writeProgress` semantics.
*/
def writesProgress: Pipe[F, Byte, Int] = s => s.chunks.flatMap(writeProgress)
By returning a stream of their progress, a caller can implement a timeout that only triggers if individual writes to the underlying socket take too long.
Unfortunately, default implementations must be provided to preserve bincompat. The writesProgress implementation would work in general, but writeProgress would need a useful override in each subclass to report incremental progress.
- 主要语言
- Scala
- 星标
- 2.5k
- 派生
- 633
- 平均合并
- 3 天 21 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
typelevel/fs2 的其他 Issue
-
Reading from a socket gets stuck on Node.js 26可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 3 天内回复
-
Scala Native TLSSocket#applicationProtocol behavior is inconsistent with JVM可能已有人在做 @reardonj 于 23 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 3 天内回复
相似的 Issue
-
No test covers transaction re-request after a delivery timeout可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
ergoplatform/ergo#2916 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
Area: PDF support
难度 2/5 1-3 小时 新手友好度 72/100
orbeon/orbeon-forms#8055 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
lichess-org/database#103 ·
-
kind:bug priority:major
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复