3 Commits

Author SHA1 Message Date
github-actions[bot]
c48b69ecee chore(release): 0.5.0 2025-11-19 20:28:01 +00:00
2ef4adaaa1 feat(message.py): add CLOSE msg constructor 2025-11-19 21:24:08 +01:00
aa0703fcde feat(types.py): add CLOSE msg ControlAction 2025-11-19 21:23:41 +01:00
5 changed files with 28 additions and 2 deletions

View File

@@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.5.0] - 2025-11-19
### Features
- [`2ef4ada`](https://gitea.pufereq.pl/judas/judas_protocol/commit/2ef4adaaa1e872c3c622ec6c37966dda1c7665d3) **message.py**: add `CLOSE` msg constructor
- [`aa0703f`](https://gitea.pufereq.pl/judas/judas_protocol/commit/aa0703fcde9d531fc5eaf8d9c93b160422692387) **types.py**: add `CLOSE` msg ControlAction
- [`332ce3f`](https://gitea.pufereq.pl/judas/judas_protocol/commit/332ce3ffa16ba43d6af1ba71bce1bc633e1661a9) **message.py**: add `acknowledged` and `ack_required` properties
## [0.4.3] - 2025-10-05 ## [0.4.3] - 2025-10-05
### Bug Fixes ### Bug Fixes

View File

@@ -4,7 +4,7 @@ build-backend = "uv_build"
[project] [project]
name = "judas_protocol" name = "judas_protocol"
version = "0.4.3" version = "0.5.0"
description = "The judas protocol" description = "The judas protocol"
readme = "README.md" readme = "README.md"
authors = [] authors = []

View File

@@ -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,
)

View File

@@ -13,3 +13,4 @@ class Category(str, Enum):
class ControlAction(str, Enum): class ControlAction(str, Enum):
HELLO = "hello" HELLO = "hello"
ACK = "ack" ACK = "ack"
CLOSE = "close"

2
uv.lock generated
View File

@@ -240,7 +240,7 @@ wheels = [
[[package]] [[package]]
name = "judas-protocol" name = "judas-protocol"
version = "0.4.3" version = "0.5.0"
source = { editable = "." } source = { editable = "." }
[package.dev-dependencies] [package.dev-dependencies]