This commit is contained in:
j3d1 2024-04-26 00:56:12 +02:00
parent fe3c9be4ab
commit 06112340dc

View file

@ -6,12 +6,10 @@ class NotificationDispatcher:
def __init__(self):
self.channel_layer = get_channel_layer()
async def dispatch(self, message):
print("Dispatching message:", message)
if not self.channel_layer:
raise Exception("Could not get channel layer")
async def run_forever(self):
# Infinite loop to continuously listen for messages
print("Listening for messages...")
while True:
@ -22,3 +20,6 @@ class NotificationDispatcher:
# Process the received message
print("Received message:", message)
await self.dispatch(message)
async def dispatch(self, message):
print("Dispatching message:", message)