ensure only broadcasting to subscribed topics
This commit is contained in:
@@ -34,6 +34,7 @@ async def channel_broadcaster(channel: WebSocketChannel, message_stream: Message
|
|||||||
Iterate over messages in the message stream and send them
|
Iterate over messages in the message stream and send them
|
||||||
"""
|
"""
|
||||||
async for message in message_stream:
|
async for message in message_stream:
|
||||||
|
if channel.subscribed_to(message.get('type')):
|
||||||
await channel.send(message, timeout=True)
|
await channel.send(message, timeout=True)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user