Naming GenServer Processes
This whole chapter we’ve been starting new GenServer processes and binding their PIDs to variables. Whenever we’ve needed to call a public function on a process, we’ve passed that variable in as the first argument. That clearly works, but it leaves us with a problem.
In a full application, we’d need to keep track of every variable for every process we started. We’d need to always keep them in scope, and we’d need to clear individual variables out when their process stopped. If that sounds really messy, it is.
It would be great if we could just name each process as we start it, and pass that name in whenever we wanted to call a function. It would be even better if we didn’t have to remember the name, but were able to ...