Skip to content

add support for payload codec system - #210

Open
om26er wants to merge 7 commits into
mainfrom
payload-codecs
Open

add support for payload codec system#210
om26er wants to merge 7 commits into
mainfrom
payload-codecs

Conversation

@om26er

Copy link
Copy Markdown
Member

No description provided.

@Mahad-10
Mahad-10force-pushed the payload-codecs branch 4 times, most recently from af8e2d3 to 54adba6CompareOctober 30, 2025 15:10
@om26erom26er changed the title add initial support for payload codecadd support for payload codec systemOct 30, 2025
Comment threadtests/codec_test.py
session = connect_anonymous("ws://localhost:8080/ws", "realm1")
session.set_payload_codec(ProtobufCodec())

def event_handler(event: Event):

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this func needs to handle that directly (of course the unerlying logic needs fixing)

Suggested change
defevent_handler(event: Event):
defevent_handler(create: ProfileCreate):

Comment threadxconn/codec.py Outdated
"""Serialize a Python object to bytes."""
raise NotImplementedError

def decode(self, data: bytes | str, out_type: Type[T]) -> T:

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defdecode(self, data: bytes|str, out_type: Type[T]) ->T:
defdecode(self, data: Invocation|str, out_type: Type[T]) ->T:

We actually need a new class that essentially has args, kwargs and details. but is "neutral" to cover Event/Invocation

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@om26er@Mahad-10