-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
async/await #1654
Comments
Some concerns with simply using futures 0.3 directly in hyper:
|
I think this is a goal of the Futures (or wg-net?) team, as suggested by the 0.3 alpha announcement:
|
Here’s a WIP blog post on the compatibility layer available since futures-preview 0.3.0-alpha.3, it should be possible with this to use hyper in an async fn. In fact, rereading it now the final example is using |
Experience ReportI started experimenting in a branch to see how it went, what follows is a report of my experience:
|
Report 2
|
Thanks for checking this out @seanmonstar! Do you think you could push your branch somewhere? Some of this feedback is hard to understand without context. When we chatted on Discord, we summarized these issues as:
More in-depth responses:
Yep -- we talked about this some on Discord, but it's worth elaborating here. I think this is one of the core questions for the design of the async/await syntax, and I agree that the current setup has some pretty annoying downsides. Finalizing this syntax is one of the main blockers to stabilizing async/await. I do want to note, however, that it's not an option to determine the borrowing structure by the body of the function -- it needs to be driven purely by the signature (with whatever elision rules we decide on). I'll get a general issue started for discussing alternatives and ping here once that's ready.
Is this related to futures 0.3? In general
Yep, the ergonomic "cliff" around different borrow modes here is suboptimal. This is directly connected to the first item, and is part of the design space there.
This is one place where pointers to code would help -- it's hard to say much about this without context. In particular, it's worth trying to see whether borrowing in this context is possible. But in general, yes
This is another place where seeing the diff would be helpful. |
There has been a new RFC to stabilize |
Closing as we don't really need to track the experience of using |
This is to track the status of being able to use
async
/await!
both with and in hyper.Relevant links:
The text was updated successfully, but these errors were encountered: