swift-server / swift-server/async-http-client
Accept any EventLoops in `.delegate(on:)`, not just ones from AHC's own ELG
还没有人认领这个 Issue。
- 主要语言
- Swift
- 星标
- 1.1k
- 派生
- 156
- PR 合并指标
- 30 天内没有已合并 PR
描述
The badly named but highly useful .delegate(on:) specifies two things:
- Which
EventLoopthe returned futures are bound to - Which
EventLoopthe delegate callouts happen on.
Crucially it does not specify on what EventLoop the underlying Channels are running on. Yes, as an optimisation if possible & sensible (i.e. the connection pool doesn't already have a valid connection) we try to create new Channels on the same EventLoop but that's neither guaranteed nor required.
Expected behaviour
If I pass a random EventLoop to AHC's eventLoop: .delegate(on: myRandomEL) then I would expect this to work, even if AHC itself is using an EventLoopGroup that doesn't contain my EventLoop for its Channels.
Actual behaviour
AHC crashes and tells me that I can only use EventLoops from AHC's EventLoopGroup at runtime. That's bad an unnecessary.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 .delegate(on:) 入口开始,跟踪将传入的 EventLoop 限制为 AHC 自有 EventLoopGroup 的运行时验证。使用来自独立 group 的 EventLoop 添加覆盖,然后验证委托能够在不发生崩溃的情况下工作,同时底层 Channels 仍由 AHC 管理。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- swift
- 领域
- networking
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100