Would it be a good idea to add everyone that has an open connection to a list of dictionaries and when 2 people are connected to remove them from the list? And how can I guarantee that the channels limit is just 2 and there won't be anyone joining by mistake? Or I just didn't get your idea. Thanks for the spent time :)
събота, 14 януари 2017 г., 22:51:59 UTC+2, Andrew Godwin написа: > > Your best bet is probably to use a database to track who's currently got > an open connection and their reply channel, and then use database rows to > match pairs together (in another table). > > Your message received code can then look up the other side in the table > and forward it to that reply channel. I don't think groups would help too > much here. > > Andrew > > On 14 Jan 2017 12:41, "Nikoleta Misheva" <[email protected] <javascript:>> > wrote: > >> Hello fellows, I started to go into channels and I saw the example for >> multiplex chat but it is not excactly what I want and I will be happy if >> someone can point me in the right direction or show me an example. >> So I want to have many dynamically created rooms than will be destroyed >> after the session which the multiplexing example here >> <https://github.com/andrewgodwin/channels-examples/tree/master/multichat> >> takes >> care of. But want I specifically want to do is to have only 2 people in a >> room randomly matched and connected. >> >> *Here is an example: * >> User1 clicks a button and user2 clicks the button too and so they are in >> something like a list with people that are online, then I randomly pick the >> 2 of them to connect to each other in a private room only for them which >> will be destroyed when they left >> >> Thank you in advance >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/fae01772-7a30-4552-a104-0e5f519733de%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/fae01772-7a30-4552-a104-0e5f519733de%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/313561f4-9d87-4d42-aa86-516cde037ee6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

