Skip to content

Commit

Permalink
Add docstring for notify()
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Nov 22, 2024
1 parent 4387947 commit ef0c88f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wlm_server/operation/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,13 @@ 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]):
"""Notifies the operation change to the channels that belong to the same group.
Args:
event: Dictionary with two keys.
type: Please refer to the documentation of Channels.
message: Dictionary with one key.
on: Updated operation status.
"""
message = event['message']
await self.send(text_data=message)

0 comments on commit ef0c88f

Please sign in to comment.