<div dir="ltr">On 14 May 2016 at 00:59, Ryan Stewart <span dir="ltr"><<a href="mailto:zzantozz@gmail.com" target="_blank">zzantozz@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Oliver: there is no restart for children under a simple 1-1 supervisor as documented under Supervision Principles at <a href="http://erlang.org/doc/man/supervisor.html#id243029" target="_blank">http://erlang.org/doc/man/supervisor.html#id243029</a><div><br></div><div>Otoh, I have to strongly disagree with Chandru about there being "no point" in supervising a connection process. Depending on the nature of your application, there can be a *huge* benefit in supervision, which is orderly shutdown. With a proper supervisory tree, you can ensure that all connection processes have a chance to finish their work and shut down cleanly when you stop your application.</div></div></blockquote><div><br></div><div>Cleanup can be done in the terminate callback if you use process_flag(trap_exit, true). You need to supervise a process primarily if you want it *restarted*, not for cleanup. Yes, you do have orderly shutdown mechanisms if the number of restarts exceed a "normal" value, but that is not the situation here. </div><div><br></div><div>Oliver has a server process to which clients connect. He does not need a supervisor for this because it is up to the client to reconnect if a connection is lost.</div><div><br></div><div>cheers,</div><div>Chandru</div></div></div></div>