I'm not aware of any way to implement the "wait 10 minutes" logic in the standard supervisor pattern.
</div><div><br></div><div>The way we've handled something like this in the past is to have a separate gen_server running higher up the tree that the server (the url fetcher in your example) calls into at startup. This gen_server keeps track of how many initialisations there have been, and performs timer:sleep()s as appropriate - in our scenario, it was a simple exponential back off algorithm.</div><div><br></div><div>Not particularly pretty, but it did drop in with almost no change to the rest of the system. Some sort of supervisor callback at termination time would be much more preferable, but I don't know of a mechanism for that - would be glad to hear other suggestions!</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</div><div>-- <br>Steve Strong<br>Sent with <a href="http://www.sparrowmailapp.com/?sig">Sparrow</a><br></div>
<p style="color: #A0A0A8;">On Friday, 26 August 2011 at 07:56, Max Lapshin wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div>On Fri, Aug 26, 2011 at 9:47 AM, Bengt Kleberg<br><<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:<br><blockquote type="cite"><div>Would it be possible to have a supervisor between the master supervisor<br>and the one that dies?<br>This new supervisor could handle the behavior you described before, but<br>has gotten lost from this email. It was something about 1 minute, I<br>think.<br></div></blockquote><br>I can add as much supervisors as required. But I don't understand how<br>to write my own callback, that will be called if some child<br>of supervisor is dead.<br>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:email@example.com">firstname.lastname@example.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div></div></span>