[erlang-questions] How to find Pids of the children of a supervisor

Joe Armstrong erlang@REDACTED
Thu Dec 7 13:33:36 CET 2017

I was asked the following in a direct mail to me:

"Given two worker processes in a supervision tree, A and B, if A wants
to message B, how should it obtain the pid of B ?"

Pretty good question.

I think the answer is to use supervisor:which_children/1 and to name
the supervisor and all the children.

Is the the best way? - does anybody have an example?



More information about the erlang-questions mailing list