I think something like that would work – but I think the spot I’d like a callback from would be at this line (where listeners doesn’t seem to be involved, I think…):
But they are called here, directly in the unregister function which is what your question seemed to be about… is there some reason that’s not good enough/an edge case we’re missing you’re trying to handle?:
That’s what the documentation refers to. You are only notified of explicit registration/unregistration. If you want to know a process crashed, then you need to monitor it, as suggested by @benwilson512.
For anyone interested, I ended up keeping Registry for concurrent access to the data – and then running a GenServer that subscribed to a pubsub that would explicitly check Process.alive? from the pids coming out of Registry for my edge cases.