Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upasync/await #1654
Comments
seanmonstar
added
B-upstream
S-feature
labels
Sep 14, 2018
This comment has been minimized.
This comment has been minimized.
|
Some concerns with simply using futures 0.3 directly in hyper:
|
This comment has been minimized.
This comment has been minimized.
|
I think this is a goal of the Futures (or wg-net?) team, as suggested by the 0.3 alpha announcement:
|
This comment has been minimized.
This comment has been minimized.
Nemo157
commented
Sep 14, 2018
|
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 |
This comment has been minimized.
This comment has been minimized.
Experience ReportI started experimenting in a branch to see how it went, what follows is a report of my experience:
|
This comment has been minimized.
This comment has been minimized.
Report 2
|
This comment has been minimized.
This comment has been minimized.
aturon
commented
Sep 21, 2018
|
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. |
seanmonstar
referenced this issue
Nov 12, 2018
Open
RFC: stabilize `std::task` and `std::future::Future` #2592
This comment has been minimized.
This comment has been minimized.
|
There has been a new RFC to stabilize |
seanmonstar commentedSep 14, 2018
•
edited
This is to track the status of being able to use
async/await!both with and in hyper.Relevant links: