News for hackers. Stuff that matters.
Re:Get to Know the Actor Model with JavaScript by mercer on Wednesday September 06, 2017 @03:28AM (#15181832)
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.
Re:Get to Know the Actor Model with JavaScript by innocentoldguy on Wednesday September 06, 2017 @12:29PM (#15184927)
Right. 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.
Re:Get to Know the Actor Model with JavaScript by sprt on Wednesday September 06, 2017 @04:55AM (#15182149)
What 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.
Re:Get to Know the Actor Model with JavaScript by mercer on Wednesday September 06, 2017 @10:02AM (#15183713)
It 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.
Re:Get to Know the Actor Model with JavaScript by zzzcpan on Wednesday September 06, 2017 @08:19AM (#15183011)
If 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