It seems you send "close": True to the group when a connection comes in,
which means that only one websocket at a time is going to be open in it
(all others in the group will be disconnected when a new one connects)

Andrew

On Sun, Aug 6, 2017 at 9:48 AM, Luís Antonio De Marchi <l...@snowmanlabs.com
> wrote:

> I'm using:
> Django==1.11.3
> channels==1.1.6
>
>
> When the user connects to the websocket, I do the following:
>
> @channel_session
> def connect(self, message, **kwargs):
>     group = Group('user-%s' % user.uuid)
>     # Do not use more than one device.
>     group.send({"close": True}, immediately=True)
>     group.add(self.message.reply_channel)
>
> I've created this method to send information to some specific user:
>
>
> from channels.generic.websockets import WebsocketMultiplexer
>
> def custom_reply(uuid: UUID, stream, action, data={}, response_status=200):
>     if type(action) is ActionType:
>         action = action.value
>
>     payload = {
>         'errors': [],
>         'data': data,
>         'action': action,
>         'response_status': response_status
>     }
>
>     WebsocketMultiplexer.group_send(name='user-%s' % uuid,
>                                     stream=stream,
>                                     payload=payload)
>
>
>
>
>  For several minutes this method sends the message to the client, after a
> while it seems that the users within the group are being reset and then the
> client is losing message
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/4a819a9c-b791-4c89-a996-
> 09ab2e07a2ed%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/4a819a9c-b791-4c89-a996-09ab2e07a2ed%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 developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFwN1urcDotFNtNi5qpKN3AiaxkG4VCMUgd1TmTmUwwwBCWabw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to