mirror of
https://github.com/django/daphne.git
synced 2025-07-08 22:03:06 +03:00
added encoding and self.stream-check to trigger_outbound
This commit is contained in:
parent
1cca353e51
commit
6104f89925
|
@ -97,9 +97,13 @@ class Binding(object):
|
||||||
self = cls()
|
self = cls()
|
||||||
self.instance = instance
|
self.instance = instance
|
||||||
# Check to see if we're covered
|
# Check to see if we're covered
|
||||||
|
assert self.stream is not None
|
||||||
|
payload = self.serialize(instance, action)
|
||||||
|
if payload != {}:
|
||||||
|
message = WebsocketDemultiplexer.encode(self.stream, payload)
|
||||||
for group_name in self.group_names(instance, action):
|
for group_name in self.group_names(instance, action):
|
||||||
group = Group(group_name)
|
group = Group(group_name)
|
||||||
group.send(self.serialize(instance, action))
|
group.send(message)
|
||||||
|
|
||||||
def group_names(self, instance, action):
|
def group_names(self, instance, action):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user