appcues / mojito

An easy-to-use Elixir HTTP client, built on the low-level Mint library.
https://hexdocs.pm/mojito/Mojito.html
MIT License
349 stars 34 forks source link

Fix returning HTTP/1.1 connections back to the pool with inflight requests #85

Open DunyaKokoschka opened 3 years ago

DunyaKokoschka commented 3 years ago

If we receive a timeout while waiting for a response then it is possible to return the connection back to the pool while we are still waitiing for the response. For HTTP/1.1 this will trigger the pipelining logic within Mint. However, Mint does not let us call stream_request_body while pipelining requests. Also, pipelining is not necessarily desirable since the client has to wait for their previous timed out response to be received before they are able to receive the response for their new request.