4 ms·
There are infinite ways of dealing with failure. Erlang gives you the building blocks, if you need something more complex, you're supposed to have to write some
by sph 4y ago
There are infinite ways of dealing with failure. Erlang gives you the building blocks, if you need something more complex, you're supposed to have to write some code. How is this surprising?
In fact, I am writing this week a dynamic process pool in Elixir which is so peculiar in its requirements I don't think I've ever seen anywhere, and it's in total 500 lines of code spread over 2 GenServers (+ Registry and DynamicSupervisor). I reckon it would easily be 25x as much in C++ or Rust.
If you want exponential backoff, I suppose it should be pretty easy to implement with a custom Supervisor (though the best practice would be to have a sidecar GenServer to deal with the backoff/alerting business rules, and using a regular Supervisor.)
- davidw 4y agoThis is the kind of thing I'm talking about though... we go from "Erlang is a piece of cake for distributed systems" to some pretty advanced concepts and telling people to "roll your own" for an extremely common use case: not wanting your entire application to be taken down by an unreachable external service. Back in the day, I found this to be a pretty good 'circuit breaker' type of thing: https://github.com/jlouis/fuse https://github.com/jlouis/fuse I wrote something similar for the (OTP) application level: https://github.com/davidw/hardcore https://github.com/davidw/hardcore
- sph 4y ago> not wanting your entire application to be taken down by an unreachable external service If your BEAM app goes down because your GenServer crashes, something is terribly wrong with your code.