I am trying to create a process in Erlang that can monitor itself and restart of it exits. So far I've had no luck at all, so don't have any code to show. Is this even possible in Erlang, and if so how?
Edit: J Fritsch posted a link to a sample that monitors itself but only once. If exit(Doctor, doctor). is used twice it doesn't work the second time. Any ideas on how to get round this?
If the process doing the monitoring is the one doing the dying, you will invariably get yourself into knots.
Use a supervisor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With