Skip to content

[RFC] Add async/await proposal #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add FAQ about convenience APIs
  • Loading branch information
fabianfett committed Aug 17, 2021
commit 22d8b4594bba913ec6390ab284d5208ba4fe80c2
3 changes: 2 additions & 1 deletion docs/async-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ request.headers = [
"content-type": "text/plain; charset=UTF-8"
"x-my-fancy-header": "super-awesome"
]
request.body = .sequence("Hello world!".utf8)
request.body = .bytes("Hello world!".utf8)

var response = try await client.execute(request, deadline: .now() + .seconds(5))

Expand All @@ -183,6 +183,7 @@ default:
```

- **What happens with all the other configuration options?** Currently users can configure a TLSConfiguration on a request. This API doesn't expose this option. We hope to create a three layer model in the future. For this reason, we currently don't want to add per request configuration on the request invocation. More info can be found in the issue: [RFC: design suggestion: Make this a "3-tier library"][issue-392]
- **What about convenience APIs?** This is our first proposal for an async/await API. We are hesitant at the moment to think about convenience APIs, since we would like to observe actual API usage. Further before we define convenience APIs, we would like to come up with a final API design for the mentioned ["3-tier library"][issue-392], to ensure those would be covered with the convenience API as well.


[SE-0296]: https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md
Expand Down