I\'m currently creating a random chat application where the user presses a button and is paired with another user and then they can chat.
I plan on using Parse for user c
This is a cool use case. Here's some insight into how to get started with this design.
ch_user123 and cg_user123, respectively.cg_idle, cg_searching, cg_active. This channel group will contain all the unique user channel names of users that are not actively engaged in a chat and not searching for a chat partner.When a user logs in (successfully), your server will add that user's unique channel to the channel group idle and to the user's unique channel group (IOW - add ch_user123 to cg_user123 and to cg_idle
When a user clicks the search for chat partner button, your server app will
cg_idle channel groupcg_searching channel grouplist_channels of the cg_idle to get a list of chat partner candidatescg_idle candidatescg_idle again to get an updated list) - IOW, go back to step 4cg_idle and add it to cg_activecg_searching and add it to cg_active1234-5678-9ABC to cg_user123 and cg_user456. These two users are not subscribe to the same channel to begin their chatting adventure with each other.cg_active, added to cg_idle, and the share chat channel is removed from both users' unique channel groups.I can think of several details and features that would need to be addressed above and race conditions that your service would have control but this should expose how you can use channel groups to control the state of the users and a way of creating a name directory of users.