So I’m working on a small game and I want to enforce that each logged in user can only have one websocket instance open at a time. I’d prefer to do the check on the socket-level instead of the channel-level so that I don’t have to repeat the check on every channel.
So far I’ve tried to create a new unique
Registry and register in the
connect/3 callback but that doesn’t work because the
connect/3 callback is not called from the user socket process (by that I mean that it is not called with from the
transport_pid process, I am actually not sure where it is called from, but I do know that the process it is called from is not persistent so the registry doesn’t keep the registration).
Any ideas on how to implement said check?