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

client: add timer() option #25

Merged
merged 2 commits into from
Nov 15, 2023
Merged

Conversation

howardjohn
Copy link
Contributor

@howardjohn howardjohn commented Mar 9, 2023

Currently, a timer must be provided to use http2. However, this has no option to actually configure this. This PR introduces a new function to set the timer. With this, I am able to successfully make HTTP2 calls with the Client (as long as there is no error - currently we hit a todo!() on errors)

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

What do you mean it fails without a timer? That should be fixed if that's the case, a timer shouldn't be required.

src/client/legacy.rs Outdated Show resolved Hide resolved
@howardjohn
Copy link
Contributor Author

What do you mean it fails without a timer? That should be fixed if that's the case, a timer shouldn't be required.

Right now I am getting a panic here https://github.com/hyperium/hyper/blob/9ed175d1545fa338b6212c4f48be9b3d12821c7a/src/common/time.rs#L61 called from Client::send_request, which eventually calls __timer.sleep(interval) as part of the keepalive for channel.

I am not seeing where pool has a timer, looks like spawn_idle_interval alwys uses tokio::time::interval if I am reading things right

@seanmonstar
Copy link
Member

Ah, is that because you're setting some of the HTTP/2 keep-alive options?

@howardjohn
Copy link
Contributor Author

Hey @seanmonstar , just coming back to this. I think this is ready to go from my POV, let me know what you think when you have a chance?

Currently, a timer must be provided to use http2. However, this has no
option to actually configure this. This PR introduces a new function to
set the timer. With this, I am able to successfully make HTTP2 calls
with the Client.
@seanmonstar seanmonstar changed the title client: add http2_timer option client: add timer() option Nov 15, 2023
src/client/legacy.rs Outdated Show resolved Hide resolved
@seanmonstar seanmonstar merged commit 0c187a3 into hyperium:master Nov 15, 2023
15 checks passed
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