stash
This commit is contained in:
parent
0e84994b62
commit
e88bbc75f3
1 changed files with 5 additions and 4 deletions
|
@ -6,12 +6,10 @@ class NotificationDispatcher:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.channel_layer = get_channel_layer()
|
self.channel_layer = get_channel_layer()
|
||||||
|
if not self.channel_layer:
|
||||||
async def dispatch(self, message):
|
raise Exception("Could not get channel layer")
|
||||||
print("Dispatching message:", message)
|
|
||||||
|
|
||||||
async def run_forever(self):
|
async def run_forever(self):
|
||||||
|
|
||||||
# Infinite loop to continuously listen for messages
|
# Infinite loop to continuously listen for messages
|
||||||
print("Listening for messages...")
|
print("Listening for messages...")
|
||||||
while True:
|
while True:
|
||||||
|
@ -22,3 +20,6 @@ class NotificationDispatcher:
|
||||||
# Process the received message
|
# Process the received message
|
||||||
print("Received message:", message)
|
print("Received message:", message)
|
||||||
await self.dispatch(message)
|
await self.dispatch(message)
|
||||||
|
|
||||||
|
async def dispatch(self, message):
|
||||||
|
print("Dispatching message:", message)
|
||||||
|
|
Loading…
Reference in a new issue