swift-server / swift-server/async-http-client

Accept any EventLoops in `.delegate(on:)`, not just ones from AHC's own ELG

Đang mở
#653 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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:

  1. Which EventLoop the returned futures are bound to
  2. Which EventLoop the 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.