4 ms·
In earlier versions of Elixir where you had to explicitly add the libraries as additional processes to start, I remember being very confused why things like e.g
by dceddia 5y ago
In earlier versions of Elixir where you had to explicitly add the libraries as additional processes to start, I remember being very confused why things like e.g. an HTTP client needed its own process. To be honest I still felt a little uneasy about it every time. Thinking of those processes as just “the library needs some internal state” makes so much more sense!
- dnautics 5y agoProblem is, it's not entirely clear that an http client library needs external state. (And for example, mint does not).
- masklinn 5y agoPersistent connections? Cookies? Response cache? Conditional requests?
- chii 5y agodepends on how low level you want the library to be - for example, cURL doesn't have state.
- masklinn 5y agoThat is incorrect. Libcurl has a connection cache for persistent connections enabled by default. It also supports automatically recording and resending cookies (including optionally storing those cookies to disk for cross-session usage), though that is not enabled by default. In 2020, the CLI cURL utility also added support for conditional requests, although that is not native to the underlying libcurl.