generated from pufereq/python-template
feat(message.py): add CLOSE msg constructor
This commit is contained in:
@@ -181,3 +181,20 @@ class Message:
|
|||||||
acknowledged=False,
|
acknowledged=False,
|
||||||
ack_required=True,
|
ack_required=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def close(cls) -> Message:
|
||||||
|
"""Create a CLOSE message.
|
||||||
|
Prompts the recipient to close the connection and not reconnect.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Message: The created CLOSE message.
|
||||||
|
"""
|
||||||
|
return cls(
|
||||||
|
id_=None,
|
||||||
|
category=Category.CONTROL,
|
||||||
|
action=ControlAction.CLOSE,
|
||||||
|
payload={},
|
||||||
|
acknowledged=False,
|
||||||
|
ack_required=True,
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user