Skip to content

Conversation

@mordak
Copy link
Contributor

@mordak mordak commented May 23, 2021

Addresses #191 .

Also includes the changes in #201 for convenience.

Note that this change effectively requires that the underlying transport implements the SetReadTimeout trait from extensions::idle. I am not sure if this is a problem or not. If so, I can add the old wait_while() back with a different name (wait_notimeout_while()?) to restore the functionality. I opted to remove it because the old wait_keepalive_while function was already broken for non-SetReadTimeout transports, and it was the recommended way to do it. I am unsure if the extra API is worth it since implementing SetReadTimeout is so trivial. Happy to get feedback on this.

Note that this also makes keepalive the default, since it is the recommended way to do it. An opt-out function is provided (no_keepalive()) for users who do not want this. I figured that the recommended path should also be the default.


This change is Reviewable

@codecov
Copy link

codecov bot commented May 23, 2021

Codecov Report

Merging #202 (2c30de0) into master (55cd646) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted Files Coverage Δ
src/client.rs 86.37% <0.00%> (ø)
src/client_builder.rs 27.27% <ø> (ø)
src/error.rs 2.66% <ø> (ø)
src/extensions/idle.rs 0.00% <0.00%> (ø)
src/types/deleted.rs 98.61% <ø> (ø)
src/types/unsolicited_response.rs 40.00% <0.00%> (-2.86%) ⬇️

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think it makes complete sense to make keep-alive the default, and I think it's fine to require SetReadTimeout 👍

mordak added 2 commits May 25, 2021 19:28
Also kill timed_wait because it is only used in one place.
@mordak
Copy link
Contributor Author

mordak commented May 26, 2021

I think we are good to go on this one?

Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks!

Separately, we really need to figure out what causes that CI failure all the time. Maybe it's time to drop the FreeBSD compile check altogether..

@jonhoo jonhoo merged commit d8d69a3 into jonhoo:master May 27, 2021
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