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

Document that by default you will receive tcp messages in the process that calls `Mojito.request` #18

Closed axelson closed 5 years ago

axelson commented 5 years ago

From a slack discussion with @gamache

gamache [9 hours ago] That's correct, the caller process will receive messages of the form {:tcp, _, _} and {:ssl, _, _} and handle them transparently.

gamache [9 hours ago] Other messages will be left in the mailbox, which should keep most callers out of trouble, but if other TCP/SSL messages were expected, Mojito will gobble them up. In that case, wrap the one-off request in a Task or use Mojito.Pool to make requests.

I think this should be called out on the docs at https://hexdocs.pm/mojito/0.2.1/Mojito.html#request/1 and https://hexdocs.pm/mojito/0.2.1/Mojito.html#request/5

And the module doc could probably be a little more explicit as well.

gamache commented 5 years ago

You're absolutely right, I will document this better. It's in the module docs, but I will add it to the function docs as well.

axelson commented 5 years ago

Great, thanks!