sneako / finch

Elixir HTTP client, focused on performance
MIT License
1.23k stars 114 forks source link

Add request_timeout for HTTP/2 #264

Open lessless opened 4 months ago

lessless commented 4 months ago

Hey,

I'm dealing with a service that supports only HTTP/2 and dies quite often because of the request_timeout:

* (Finch.Error) request_timeout
    (req 0.4.9) lib/req.ex:978: Req.request!/2
    (grocery_times 0.1.0) lib/grocery_times/sainsburys_product_collector.ex:11: GroceryTimes.SainsburysProductCollector.process/1
    (elixir 1.16.1) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.16.1) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (grocery_times 0.1.0) lib/grocery_times/sainsburys_product_collector.ex:6: GroceryTimes.SainsburysProductCollector.process/1
    iex:6: (file)

Per request docs https://hexdocs.pm/finch/Finch.html#request/3 , Finch currently supports request_timeout for HTTP/1, and it will be great to have it for the HTTP/2 as well.