apple / apple/swift-http-api-proposal
[AsyncStreaming] Explore using a `[Write/Read]Result` instead of an `EitherError`
Open
async-streaming
kind/usability
status/needs-design
- Dominant language
- Swift
- Stars
- 66
- Forks
- 21
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 2
Description
Currently, the various read and write methods are using the `EitherError` type since we need to use typed throws but also account for different errors from the underlying writer and the closure that gets the spans. This isn't very ergonomic and it might be better to stop using throws all-together and instead explore introducing a new result-like type similar to the below:
```swift
enum WriteResult {
case success(Success)
case writeFailed(WriteFailure)
case producerFailed(Failure)
}
````
Contributor guide
Assessment
This issue has not been assessed yet.