swift-server / swift-server/async-http-client
Accept any EventLoops in `.delegate(on:)`, not just ones from AHC's own ELG
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Swift
- Star
- 1.1k
- Fork
- 156
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu tại điểm vào .delegate(on:) và theo dõi quá trình xác thực runtime giới hạn EventLoop được cung cấp vào EventLoopGroup riêng của AHC. Bổ sung coverage bằng cách sử dụng một EventLoop từ một group riêng biệt, sau đó xác minh rằng việc ủy quyền hoạt động mà không bị crash, trong khi các Channels bên dưới vẫn do AHC quản lý.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- swift
- Lĩnh vực
- networking
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100