I am using mnesia to store Pid's for users that have connected to a certain websocket.
-record(connection, {pid, name}).
handle_join(ServiceName, WebSocketId, State, EventName) ->
mnesia:dirty_write(#connection{pid=WebSocketId, name=EventName}).
The Pid is the key, using the tv:start() application I am able to see the Pid is being stored properly in the connection table. I want to now be able to send a message to all Pids in that table and also remove the Pid when the websocket connection closes.
What is the best way to retrieve all the Pids from that connection table?