4 ms·
Don't forget fault tolerance! In my particular use cases concurrency is not really necessary, but I love the fact that I don't have to be quite as 'defensive' i
by mercer 9y ago
Don't forget fault tolerance! In my particular use cases concurrency is not really necessary, but I love the fact that I don't have to be quite as 'defensive' in my programming. Whenever a particular (Erlang) process/'Actor' fails, its supervisor can simply restart it and I can deal with the cause of failure later while the entire system chugs along (mostly) happily.
- sprt 9y agoWhat happens when the process is bound to fail on start? (eg. trying to bind a port that's already being used) Never used that model so I'm curious.
- mercer 9y agoIt depends on how you set things up, but one possible approach is that the supervisor, after a few retries, would also shut down, which would trigger the supervisor above that to restart the whole thing with a different port. This wouldn't make sense, probably, but maybe it illustrates how you can go about these things.
- zzzcpan 9y agoIf it fails on start you try again and again until it succeeds. There is a submission on the front page that dives in into this: https://news.ycombinator.com/item?id=15182626 https://news.ycombinator.com/item?id=15182626
- innocentoldguy 9y agoRight. Elixir and Erlang's fault tolerance is amazing. I think it is important to point out that to use Elixir's let-it-fail mechanisms, you have to use concurrency. You can't have a supervisor and supervised code running in the same process, so you have to use concurrency in order to benefit from this fault tolerant mechanism.