Using Registry as a counter? (or better alternatives?)

I think that what I would like to understand is if in “simpler” situations you can rely on using terminate, because if you can reliably write a gen_server that only does some simple processing, writing a single terminate callback is fairly less involved than spinning up additional processes and setting up monitoring. Basically it goes back to, when can we rely on terminate and I think you’ve given a lot of info when it might be appropriate to do so, but you end up the previous post by saying that “a lot of preconditions must be satisfied” and that you find it hard to reason about it in those terms. Hence it seems that you’re advocating that monitoring the process is indeed the best way to go about it, so back to the “don’t rely” on terminates. I created a new topic with an actual sample gen_server.