Skip to content

Conversation

zino299792
Copy link

@zino299792 zino299792 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.

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

zino299792 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

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

zino299792 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