[erlang-questions] Get grandchild pid when using nested supervisors?

Roger Lipscombe roger@REDACTED
Mon Sep 29 18:10:15 CEST 2014


I'm attempting to use nested supervisors, as follows:

Top -> A (simple_one_for_one) --temporary--> B (one_for_one) --transient--> W

The point of this is so that, if W crashes, it gets restarted
according to B's strategy, but that -- if the restart intensity is
reached, A is _not_ killed (because it's supervising a large number of
B->W pairs). There's only one W for each B.

So, the first question: is this sane? Or is there a better way to
implement this?

Assuming it is sane, my second question:

Calling supervisor:start_child(A, []) returns {ok, BPid}, where I
really want WPid. What's a sensible way to get hold of it?

Thanks,
Roger.



More information about the erlang-questions mailing list