feat(python): add WebSocketConfig transport configuration - #4000
Conversation
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4000 +/- ##
==========================================
Coverage 84.91% 84.92%
Complexity 1405 1405
==========================================
Files 1224 1224
Lines 179301 179560 +259
Branches 145615 145614 -1
==========================================
+ Hits 152250 152485 +235
- Misses 23024 23029 +5
- Partials 4027 4046 +19
🚀 New features to boost your workflow:
|
slbotbm
left a comment
There was a problem hiding this comment.
Other than the comments below, the API exposed in this PR does not match the established pattern, which is IggyClient(server_address: str | TcpConfig | ...). Let's conform to that pattern instead of exposing .websocket method.
There was a problem hiding this comment.
No need for examples like these. You can add comments to the existing examples on how to configure different transports instead.
| inner.max_write_buffer_size = | ||
| Some(usize_param(max_write_buffer_size, "max_write_buffer_size")?); | ||
| } | ||
| if let Some(max_message_size) = max_message_size { |
There was a problem hiding this comment.
Passing None for max_message_size or max_frame_size cannot disable the limit as documented. An omitted argument and an explicit Python None both arrive as Option<i64>::None, the constructor starts from the Rust defaults of 64 MiB and 16 MiB, and these assignments run only for Some. The Rust to_tungstenite_config() conversion also leaves tungstenite's default in place when its field is None. A caller that requests no limit will therefore still have large messages or frames rejected. Let's distinguish an omitted argument from an explicit None and make the Rust conversion call the tungstenite setters with None.
Which issue does this PR address?
Relates to #2835.
Rationale
Adds WebSocket transport support to the Python SDK, following the same Config pattern already used for TCP.
What changed?
Adds WebSocketConfig, WebSocketReconnectionConfig, and WebSocketFramingConfig, plus IggyClient.websocket(config). Mirrors TcpConfig's fields and validation.
Local Execution
AI Usage
Claude Sonnet 5 (Claude Code)