Skip to content
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) Use the futures 0.3 - compatible versions of hyper and tokio #1071

Closed
jebrosen opened this issue Aug 2, 2019 · 4 comments
Closed

Comments

@jebrosen
Copy link
Collaborator

jebrosen commented Aug 2, 2019

hyper 0.13 and tokio 0.2 are slated to use futures 0.3. We should use those, ideally by the first release of async-capable Rocket. This would allow us to remove our own dependencies on the futures 0.1 ecosystem and the futures 0.1-0.3 compatibility layer.

The following issues make that inconvenient today:

  • These are currently the master branches of those projects, planned for hyper 0.13 and tokio 0.2. The port to futures 0.3 is still fresh, and we don't want to point to hyper@master until it settles a bit.
  • We need hyper::body::Sender to implement the new Sink trait, or find a different approach for that section of code. Using a different approach.
  • ~~ hyper's requirements on executors - see also (async) Support launching on a custom runtime #1068 ~~ hyper requires a tokio runtime as its executor, so this is resolved
  • Keep in mind that this update should only affect internal APIs. If the futures 0.1 ecosystem has already "leaked" into rocket's public APIs, we have done something wrong!
@jebrosen
Copy link
Collaborator Author

jebrosen commented Aug 3, 2019

I've made a proof of concept / WIP: https://github.com/SergioBenitez/Rocket/compare/async...jebrosen:async-futures03-hyper?expand=1

This makes use of https://github.com/Nemo157/futures-tokio-compat because tokio's AsyncRead is different from the one in futures-preview. Given this and other incompleteness (see tokio-rs/tokio#1201), I would still like to wait a bit longer to resolve this.

@jhpratt
Copy link
Contributor

jhpratt commented Aug 9, 2019

Tokio's 0.2 alpha has been released, which includes support for std::future::Futures.

@jebrosen
Copy link
Collaborator Author

jebrosen commented Aug 9, 2019

Unfortunately hyper is completely broken for a few days due to some changes in tokio. It will maybe be fixed by hyperium/hyper#1890.

@jebrosen
Copy link
Collaborator Author

I have updated the async branch to use tokio 0.2.0-alpha.2 and an arbitrary compatible version of hyper.

As the commit message explains, tokio-rs/tokio#1356 causes some tests to fail. My own other mistake is also causing some of the same tests to fail, and I would like to wait for the upstream tokio issue to be resolved before trying too hard to fix those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants