Monitoring processes registered via Registry

when you spawn a new process, give it a name which is an atom, monitor this process, and this process crashes you will receive {:DOWN, ref, :process, object, reason} where an object is the process name.

However, when you register your process via Registry, that’s no longer the case as you cannot monitor process via the name assigned using Registry.

Isn’t this inconvenient? On the one hand I can register my process using Registry but on the other hand, if the process crashes I don’t get its name but its pid. This effectively means that I need to store a mapping pid/monitor_refprocess_name to know the name of the process that crashed

1 Like

Yes, indeed. There is no easy nor feasible way around it in my humble opinion.

1 Like