Hey Brian, thanks for the clear guide. I’m curious:
Adam Pash
1
Hey, Adam.
If you check our registry, when we send a message to a process we actually need to perform a lookup to find its pid.
We are storing this state in a simple Map (%{“room name” => pid}), so we can search it in constant time (O(1)), meaning that performance shouldn’t be a real concern here.
So you can check if the page already exist (Registry.whereis_name({:page, “123”})) or you can just call your Supervisor.start_child ignoring the `:already_started` error (that's actually what I'm doing here, every time a new player joins a room, I just "start" a game).