Replies: 1 comment
-
I'm not entirely sure what the confusion is. It is a FlowControlDataQueue, created at: Line 887 in 213d1b2 And passed in at: Lines 902 to 903 in 213d1b2 In general, if you have any more questions like this, I'd suggest you try changing the annotation and then run |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm writing to express a concern about the ClientWebSocketResponse class, specifically regarding its 'reader' and 'writer' members. I noticed that while 'reader' is typed as "FlowControlDataQueue[WSMessage]", 'writer' is defined as "WebSocketWriter".
The 'WebSocketReader' class can be instantiated with a 'FlowControlDataQueue' for the 'read_queue' and an integer 'max_msg_size'. It is then injected into the 'ClientWebSocketResponse' through the 'response.connection.protocol.set_parser' of a 'ClientResponse' object.
Within the 'ClientWebSocketResponse', there seems to be a predominant use of 'FlowControlDataQueue', which is also accessible through 'WebSocketReader.queue'.
This leads me to wonder why the type of 'ClientWebSocketResponse.reader' is 'FlowControlDataQueue'. Although I am relatively new to this field, it appears more logical to me that it would be of the 'WebSocketReader' type.
Considering this, would it be more appropriate to access this via 'self.reader.queue' instead of just 'self.reader'? I am curious if there is a specific reason for the current implementation that I might not be aware of. Additionally, if changing it as suggested seems beneficial, I am willing to contribute to making this modification.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions