swift-server / swift-server/async-http-client
offer Structured Concurrency API that supports HTTP response streaming
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
Currently, most of HTTPClient's API surface only supports Structured Concurrency violating functions. Baby steps to rectify this have been done in #806. But the elephant in the room is of course the unstructured HTTP request API.
We need to also provide a
try await httpClient.execute(request) { status, responseBodyStream in
...
}
API that fulfils Structured Concurrency by supporting cancellation and tearing everything down when the body function returns or throws without ineffective and ugly hacks like deinit (which still violates Structured Concurrency because it doesn't follow the structure of the code).
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 by reviewing HTTPClient’s existing unstructured request API and the Structured Concurrency work in #806. Define and implement the callback-based execute(request) API so cancellation is supported and the request is torn down when the body callback returns or throws.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100