apple / apple/swift-http-api-proposal

[AsyncStreaming] Explore using a `[Write/Read]Result` instead of an `EitherError`

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.