-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add client stream publisher #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question about the typing change, otherwise looks good!
@@ -98,13 +99,17 @@ def __init__( | |||
self.buffer = bytearray() | |||
self.responses: dict[int, MemorySendChannel] = {} | |||
self.encoder = PDUEncoder() | |||
self.pdu_send_channel: MemorySendChannel | |||
self.pdu_receive_channel: MemoryReceiveChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this typing information necessary? I would've thought that open_memory_channel[PDU](0)
would be typed, so that we don't need to specify the type here
return None | ||
|
||
send_channel, receive_channel = open_memory_channel[PDU](0) | ||
send_channel: MemorySendChannel | ||
receive_channel: MemoryReceiveChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here for changing this typing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially didn't have it, ruff complained about type annotation for these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class (and a few others, I expect) could really benefit from using attrs
to manage all the various fields. I think let's leave the type annotations as-is here and switch to attrs
in a separate PR.
Purpose
added a stream publisher to ensure that one pdu is sent at a time
Checklist