swift-server / swift-server/async-http-client
is `precondition(eventLoopGroup.contains(eventLoop))` required for `.delegate(on: eventLoop)`?
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
There's this assertion which tests that a provided eventLoop for a request is part of AHC's eventLoopGroup.
It's clear that this precondition is required for delegateAndChannel(on: eventLoop) but I'm not sure if it's actually required for delegate(on: eventLoop). Why could AHC not open a connection on some EL of its ELG and then call the delegate/user futures on the provided EL even if that's on another ELG?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Sources/AsyncHTTPClient/HTTPClient.swift around line 551 and compare the precondition used by delegate(on:) with delegateAndChannel(on:). Trace how the supplied event loop is used, then determine whether the current behavior should remain or support event loops outside the client’s event loop group; document the decision and add focused coverage if a change is agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100