We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
Hi All
I'm facing hyper request timeout implement/migration issue. earlier implementation is similar to below #1097
Now I am not sure what is the best practice to implement request timeout using futures and tokio.
Any link or help will be appreciated. I tried finding but could not find one.
Thanks in advance.
/Shiv
The text was updated successfully, but these errors were encountered:
Does something like this help?
use hyper::{Client, Uri}; use tokio::time::timeout; use std::time::Duration; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { let client = Client::new(); let future = client.get(Uri::from_static("http://httpbin.org/ip")); match timeout(Duration::from_millis(30), future).await { Ok(_) => println!("Got response"), Err(_) => println!("timed out"), }; Ok(()) }
Sorry, something went wrong.
No branches or pull requests
Hi All
I'm facing hyper request timeout implement/migration issue. earlier implementation is similar to below
#1097
Now I am not sure what is the best practice to implement request timeout using futures and tokio.
Any link or help will be appreciated. I tried finding but could not find one.
Thanks in advance.
/Shiv
The text was updated successfully, but these errors were encountered: