egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
372 stars 65 forks source link

Implement some sane http request timeout #127

Open loxs opened 2 years ago

loxs commented 2 years ago

Sometimes my program falls into an "endless wait" mode when the computer sleeps right when a request to twitter is made.

According to hyper docs, no timeout is configured by default: https://docs.rs/hyper/0.14.15/hyper/client/connect/struct.HttpConnector.html#method.set_connect_timeout

I suggest that we either override this by some sane default, or we expose ways for the user to specify it. Or maybe even allow the user to supply their own Hyper HttpConnector, as I would like to configure other options as well.

I am willing to contribute if an agreement is reached on how to approach this.