pid lookup via global

Nato nato@REDACTED
Fri May 8 10:14:10 CEST 2020

Hi list

I have a gen_statem where I am creating simple_one_for_one
children and using the global+term strategy. So each child's
key, as it were, is a term. I have read the manuals for
global, supervisor, sys, and can't seem to find a way to
reverse lookup a child's id, via its known Pid. I suppose
I was expecting global to have a way to do this... something
I'm missing, no doubt.

Right now, via a collect on `supervisor:which_children(foo_sup)`
I can access the child Pids, and in an unsavory way, for
each, matching on a whopper term via `sys:get_status/1` 
I can extract the Id in a `header' tuple. Is there
another way?


More information about the erlang-questions mailing list