stash
This commit is contained in:
parent
173e6a1271
commit
07b2595c7b
1 changed files with 7 additions and 6 deletions
|
@ -20,10 +20,11 @@ class NotificationDispatcher:
|
||||||
# Blocking receive to get the message from the channel layer
|
# Blocking receive to get the message from the channel layer
|
||||||
message = await self.channel_layer.receive(channel_name)
|
message = await self.channel_layer.receive(channel_name)
|
||||||
|
|
||||||
if message:
|
if (message and 'type' in message and message['type'] == 'generic.event' and 'name' in message and
|
||||||
# Process the received message
|
message['name'] == 'user_notification'):
|
||||||
print("Received message:", message)
|
if 'message' in message and 'event_id' in message:
|
||||||
await self.dispatch(message)
|
print("Received message:", message['message'], "with event_id:", message['event_id'])
|
||||||
|
await self.dispatch(message['message'], message['event_id'])
|
||||||
|
|
||||||
async def dispatch(self, message):
|
async def dispatch(self, message, event_id):
|
||||||
print("Dispatching message:", message)
|
print("Dispatching message:", message, "with event_id:", event_id)
|
||||||
|
|
Loading…
Reference in a new issue