-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Future 0.3 #543
Comments
I'm not sure what @fafhrd91 feelings on this topic. Note that there is already issue for it in actix repo. Before futures 0.3 will come to actix-web, we'd need them in actix. |
It would be interesting to see how async/await will affect actix, but I don’t have much time at the moment |
Isn't Rust 2018 planned for 1.30 or 1.31 which would mean by the end of this year? But anyway a lot of work is still being done on Futures 0.3 to include them in the standard library in their final form. I don't think it's wise to base something on it right now. |
@OtaK true. I do agree with all of the above. However, following futures, in my opinion, I think it has gotten to a point of reasonable conceptual clarity. So, I think it would be a good starting point to explore the design. And changes to futures from this point to stable is probably going to be on a progressive path without gross changes. Now, 0.2 would be an unreasonable ask. With 0.3, I think we can atleast start thinking about the design, and hence my proposition of alpha. But well, @fafhrd91 doesn't have the time right now anyway. So I suppose things will have to wait. Currently, a quarter to half of the code I write in any small project with actix is just mapping errors, converting them back and forth. Essentially criss-crossing between the 3 paradigms in rust - async/await anyway is just sugar. So, I don't think much, or if anything needs to be done about that. If it's follows a good design for future 0.3, async/await should just sit on top of it nicely. |
Check out https://github.com/mehcode/actix-web-async-await. Primary motivation was so you could use |
added link to actix-web-async-await to readme |
@fafhrd91 Would it be possible to support handlers of the form: use futures01::{future, Future}; // futures v0.1.x
use actix_web::{Path, error::Error, Responder};
fn handle(id: Path<u32>) -> impl Future<Item = impl Responder, Error = Error> {
future::ok("Hello")
} My guess is that this is complex because of the lack of stable specialization. We need to be able to support the above to allow bare |
@mehcode this is not possible without specialization or we would need to remove all Responder impls and leave only one for |
That's what I figured. Well it seems like this is a good use case to demonstrate more need for rust-lang/rust#31844. I suspect a lot of libraries that want to take advantage of |
Lo and behold! PS: I think one of the important and relevant comments: rust-lang/rfcs#2592 (comment) |
Well I predict it means nothing yet until async/await is ready which is likely to happen in the next year |
closing as this issue is not actionable |
I know it's probably early, with futures still not being stabilized. But can we please have some kinda of alpha atleast with futures 0.3. I'd be more than happy to live on the edge with changing api surface than having to do with the madness that is the future 0.1 when in comes error types.
Converting them back and forth especially when you want to return multiple different types of errors, leads to all kind of unreadable code having to bend backwards just to pass on an error.
The text was updated successfully, but these errors were encountered: