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

Request timeout broken for Mojito.Request #17

Closed mischov closed 5 years ago

mischov commented 5 years ago

The request timeout works in Mojito.Pool because the whole request process is waiting for a response in a single receive with an after based on the timeout, but I believe because Mojito.Request.receive_response is recursive-ish (it calls handle_msg which can call receive_response again) the after in each receive is for each message received rather than the request as a whole.