Django==1.11.3
channels==1.1.6
@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)
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)
--
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+unsubscribe@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.
For more options, visit https://groups.google.com/d/optout.