Skip to content

Commit

Permalink
Implement notifying operation change
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Nov 22, 2024
1 parent fd60f8f commit f08565b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wlm_server/operation/consumers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

from channels.generic.websocket import AsyncWebsocketConsumer

class OperationConsumer(AsyncWebsocketConsumer):
Expand All @@ -17,3 +19,7 @@ async def connect(self):

async def disconnect(self, code):
await self.channel_layer.group_discard(self.group_name, self.channel_name)

async def notify(self, event: dict[str, str]):
message = event['message']
await self.send(text_data=message)

0 comments on commit f08565b

Please sign in to comment.