3 ms·
There should be plenty out there. Handling failure is one of the main selling points of the Erlang/OTP ecosystem. A big part of the difference it that in a typ
by brightball 9y ago
There should be plenty out there. Handling failure is one of the main selling points of the Erlang/OTP ecosystem.
A big part of the difference it that in a typical web application in most other languages, you'll think of your system in two parts: web and background.
With an Elixir/Erlang you tend to think of the web as just one interface to the application itself. The idea of background jobs in those contexts somewhat goes out the window when you have an environment where spinning up millions of processes at the same time is the expectation and not a terrifying scaling scenario.
Think of responding to an incoming web request as just another job, essentially.
Because everything is just message passing and there is no global state, the restart just looks like a function call. The supervisor will start a new process calling the function with the arguments that were passed to it when it was created.
Here's an example that will try to explain things.
https://medium.com/@tylerpachal/let-it-crash-creating-an-example-supervisor-in-elixir-using-otp-36ea4236b02b https://medium.com/@tylerpachal/let-it-crash-creating-an-exa...
- nickjj 9y agoThanks. Also, I discovered your blog. Good stuff! Currently reading your Insanity with Elixir + Phoenix post at http://www.brightball.com/articles/insanity-with-elixir-phoenix-postgresql http://www.brightball.com/articles/insanity-with-elixir-phoe....
- brightball 9y agoAwesome! I need to update that article for the changes in Phoenix 1.3 but for the most part everything in there should be consistent.