3 ms·
To be honest I use elixir. Docs are better anyways. For timeouts that information is in the standard library, for example https ://hexdocs.pm/elixir/GenServe
by dnautics 6y ago
To be honest I use elixir. Docs are better anyways. For timeouts that information is in the standard library, for example
https ://hexdocs.pm/elixir/GenServer.html#call/3
Note that call is even more sophisticated, it incorporates a liveness check on its counterparty to quit out before timeout if there's been a catastrophe. Note this is effectively a simple form of backpressure management that degrades availability gracefully under stress in favor of ensuring the integrity of existing connections. Because fallibility is so baked into the runtime, every good library incorporates timeouts where it's sensible.
For connection pools, it's not explicitly part of the standard library but basically everyone (maybe not whatsapp) uses poolboy:
https://elixirschool.com/en/lessons/libraries/poolboy/ https://elixirschool.com/en/lessons/libraries/poolboy/
I have never used it myself, yet, but I trust more experienced devs have incorporated it successfully in ecto (rdbms) and Phoenix (web framework).