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

feat(client): expose connection reuse state to Connected #163

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zino23
Copy link

@zino23 zino23 commented Jan 20, 2025

  • Add a field is_reused to Connected and a method exposing is_reused.
  • Add a new function mark_as_reused in the Poolable interface that allows to mark a connection as reused.
  • Mark a connection as reused in Pool<T, K>::reuse via Pollable::mark_as_reused.
  • Tests
    • src/client/legacy/pool.rs: test dumb connection CanMarkReused
    • src/tests/legacy_client.rs: test capturing connection reuse info with hyper_util::client::legacy::connect::capture_connection.

Fix #3835.

@zino23 zino23 changed the title feat: expose connection reuse state to connected feat(client): expose connection reuse state to connected Jan 20, 2025
@zino23
Copy link
Author

zino23 commented Jan 20, 2025

Test results:

$ cargo test reuse --features full
running 1 test
test client::legacy::pool::tests::mark_conn_as_reused ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 38 filtered out; finished in 0.00s

     Running tests/legacy_client.rs (target/debug/deps/legacy_client-77b3265b9280e812)

running 1 test
test get_conn_reuse_info_via_connected ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 17 filtered out; finished in 0.05s

@zino23 zino23 changed the title feat(client): expose connection reuse state to connected feat(client): expose connection reuse state to Connected Jan 21, 2025
@zino23
Copy link
Author

zino23 commented Jan 22, 2025

Hi @seanmonstar, if you have time, could you take a look on this PR?

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.

hyper-util: get info about if the connection is reused in Connected
1 participant