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

update to hyper 1.0 #25

Merged
merged 1 commit into from
Dec 3, 2023
Merged

update to hyper 1.0 #25

merged 1 commit into from
Dec 3, 2023

Conversation

allan2
Copy link
Contributor

@allan2 allan2 commented Dec 1, 2023

This PR is for #24.

hyper now has its own IO traits.

This PR drops the dependency on tokio-io-timeout. Its types are now implemented here in this crate,
using hyper IO traits instead of tokio traits.

  • tokio::io::AsyncRead is switched to hyper::rt::Read, and AsyncWrite
    to Write
  • TimeoutConnectorStream, which wrapped tokio_io_timeout::TimeoutStream`, is removed

This PR is mostly finished, but I think it should be looked over. The tests that use tokio::io::AsyncExt for read are not fixed yet.

@allan2 allan2 force-pushed the master branch 2 times, most recently from a739668 to 425b612 Compare December 1, 2023 02:38
@allan2
Copy link
Contributor Author

allan2 commented Dec 1, 2023

This PR now passes all tests and is ready for review! More notes are in the commit messages.

Feedback is very welcome. Cheers!

@hjr3 hjr3 changed the title Draft: update to hyper 1.0 update to hyper 1.0 Dec 3, 2023
Fixes hjr3#24.

hyper has its own IO traits. The dependency on
tokio-io-timeout is dropped. Its types are implemented here,
implementing hyper IO traits instead of tokio.

- `tokio::io::AsyncRead` is switched to `hyper::rt::Read`, and AsyncWrite
to `hyper::rt::Write`.
- `tokio::io::AsyncSeek` is no longer needed.

The wrapper type `TimeoutConnectorStream` that formerly wrapped
tokio_io_timeout::TimeoutStream` is no longer needed.

`tokio::io` has the handy AsyncReadExt and AsyncWriteExt traits, which
were preivously used in tests. Now that we rely on Hyper IO, those had
to be ported over:

- AsyncReadExt -> ReadExt
- AsyncWriteExt -> WriteExt
- tokio internal Read -> ReadFut
- tokio internal Write -> WriteFut
@hjr3 hjr3 merged commit d3c6da9 into hjr3:master Dec 3, 2023
4 checks passed
@hjr3
Copy link
Owner

hjr3 commented Dec 3, 2023

This looks great! Thank you for all your time and effort.

@hjr3
Copy link
Owner

hjr3 commented Dec 3, 2023

https://crates.io/crates/hyper-timeout/0.5.0 - crates.io has been updated with the latest package

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

Successfully merging this pull request may close these issues.

2 participants