|
|
|
|
|
by hifly
1877 days ago
|
|
Actually in Erlang/elixir, your own crash is something you can plan for and handle. if you check the code you will see in init() that the author captures exits. then there is a function terminate () which is called when a process exits for some reason (including crashes) So for example one possible implementation of state is that you catch your own crash, save some state and then restore it when you restart You aren't supposed to ever crash, however the whole language it's based around designing a framework to handle what happens if you do crash So you design a whole framework of supervisors, watching processes, that all have a defined startup and shutdown order. You build structures with rules such as: if my cache module fails, them restart this whole chunk of application over here. it's very cool |
|