toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 74 forks source link

Allow timeouts to be set to sub-second values #166

Closed julik closed 6 years ago

julik commented 6 years ago

When dealing with fast services it is reasonable to be willing to limit the timeout to a smaller value than 1 second. We run services that are fine with 40ms-200ms response times, and if they go over that they cause upstream latencies to shoot up. We can switch to using the _MS timeout settings of libCURL to be able to set the timeouts with Float values. This gives us the possibility to tighten up the timeouts.

Also removes the artificial restriction on the timeout not being 0 since in libCURL a timeout of 0 means "no timeout" and that could also be a legitimate user need.