Notes about elixir processes
Live list of stuff I learn about elixir processes. Some of them are stupid mistakes I make
-
meaning of
:restartvalues in the child spec::permanent: always restart:temporary: never restart:transient: restart only on abnormal termination
:normalexist doesn't bring down linked processes.- but
:shutdowndoes. This is how supervision shutdown propagates down the tree. - The documentation says trapping exits makes it hard to exit when you need to. Take this advice seriously.
- If you try to “shut down” a process with
GenServer.stop/1, it will be restarted by the (dynamic) supervisor. There isDynamicSupervisor.terminate_child/1, that should be used. - Consider using the
supervisor_bridgemodule if you are working on processes that work in a non-typical way.