Can always have an ETS table with the user_id as a key and a timestamp of their last online heartbeat as an index. Then a scheduled process can sweep the ets table and remove users who have ‘disconnected’ (current timestamp is older than a set amount of time from the current time). Online status can just be if the user is in the ets table.
Its ripe for race conditions if ya use only dirty operations ![]()






















