-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use the new tokio 0.1 #1443
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
Comments
Yes, I know of it, thanks! Switching to use it will be a breaking change, and since futures will release 0.2 soon, the change will be made together, in hyper 0.12.0. I'll tag this for that milestone. |
I'm keen to attempt doing this! @seanmonstar, would you be open to accepting a PR against the |
FYI, I started spiking this out of curiosity, and opened tokio-rs/tokio#217 to follow up on a few unclarities. |
Awesome! Yea, if you want to take a stab at it, that'd be fantastic!
|
Okay, so far I have:
If you think that's enough, I can open a PR against 0.12.x and we can hash out the details there, or otherwise I'm happy to make more changes. |
Looking through my changes again, I'm wondering if we should change the API for Currently w/o any major changes to the API, integrating let http = Http::new();
tokio::run(lazy(move || {
let mut server = http.bind(addr, || { ... }).unwrap();
server.shutdown_timeout(Duration::from_secs(60));
server.run().map_err(|err| println!("error: {}", err)
})) I think it'd be neat if it looked something like this instead: let http = Http::new();
let server = http.server()
.with_shutdown_timeout(Duration::from_secs(60))
.with_error_handler(|err| println!("error {}", err))
.build(addr, || { ... });
tokio::run(server) This would require a bunch of changes, effectively delaying all I/O until the However maybe it makes sense to postpone this refactor until we have the basic changes on the 0.12.x branch, and then we can bikeshed on the API. |
Note that futures 0.2 integration is now landing in tokio, so we'll want to coordinate work here with work in #1448. To that end, getting a PR up and merged soon would be helpful, so that we can parallelize some of these API questions with the work on futures 0.2 integration. |
Understood! Just polishing up a few things, then this should be ready for PR! |
To your question about the API: I do think things should probably change up a bit!
|
Quick update here, I'm stuck on fixing up the integration tests, which has proven more difficult than I thought. Will try to push further tomorrow! |
This has been merged into the 0.12.x branch, here: 603c3e4 We can open new issues around specific API changes. |
Use the new simplified
tokio
.https://tokio.rs/blog/2018-02-tokio-reform-shipped/
The text was updated successfully, but these errors were encountered: