From ef0c88ffbbf72b7ae74a609d11582939ca2548ed Mon Sep 17 00:00:00 2001 From: Jaehun You Date: Thu, 21 Nov 2024 18:13:04 +0900 Subject: [PATCH] Add docstring for `notify()` See also: #17 --- wlm_server/operation/consumers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wlm_server/operation/consumers.py b/wlm_server/operation/consumers.py index ed5e669..6b746dd 100644 --- a/wlm_server/operation/consumers.py +++ b/wlm_server/operation/consumers.py @@ -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)