You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(websockets): address review findings on reliability rework
- derive ping_timeout as min(45, ping_interval - 1) when not supplied, so
existing callers passing only ping_interval keep working
- drain the callback queue on shutdown instead of dropping pending
messages; the None sentinel now marks end-of-stream
- report subscription watchdog timeouts and subscribe_failed events
through on_error so callers without auto_reconnect get a signal
- don't resurrect the callback worker after disconnect (stop flag is now
only cleared by connect())
- cite the Mist rate-limits doc for the channel-count constants
- document the new reliability kwargs in all channel class docstrings
- add tests: ping derivation, worker drain, worker stop guard, watchdog
expiry/cancel, subscribe_failed error reporting
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -584,12 +584,12 @@ All channel classes accept the following optional keyword arguments:
584
584
| Parameter | Type | Default | Description |
585
585
|-----------|------|---------|-------------|
586
586
|`ping_interval`|`int`|`60`| Seconds between automatic ping frames. Set to `0` to disable pings. |
587
-
|`ping_timeout`|`int`|`45`| Seconds to wait for a pong response before treating the connection as dead. When `ping_interval > 0`, this must be lower than `ping_interval`. |
587
+
|`ping_timeout`|`int \| None`|`None`| Seconds to wait for a pong response before treating the connection as dead. Defaults to `min(45, ping_interval - 1)`. When `ping_interval > 0`, this must be lower than `ping_interval`. |
588
588
|`auto_reconnect`|`bool`|`False`| Automatically reconnect on transient failures using exponential backoff. |
589
589
|`max_reconnect_attempts`|`int`|`5`| Maximum number of reconnect attempts before giving up. |
590
590
|`reconnect_backoff`|`float`|`2.0`| Base backoff delay in seconds. Doubles after each failed attempt (2s, 4s, 8s, ...). Resets on successful reconnection. |
591
591
|`queue_maxsize`|`int`|`0`| Maximum messages buffered in the internal queues used for both `receive()` and callback delivery. `0` means unbounded. When set, incoming messages are dropped with a warning when either queue is full, preventing memory growth on high-frequency streams. |
592
-
|`subscription_watchdog_timeout`|`float`|`10.0`| Maximum time to wait for all `channel_subscribed` acknowledgements after connect. On timeout, the connection is closed to trigger a clean reconnect. |
592
+
|`subscription_watchdog_timeout`|`float`|`10.0`| Maximum time to wait for all `channel_subscribed` acknowledgements after connect. On timeout, the error is reported to `on_error` and the connection is closed; with `auto_reconnect=True` this triggers a clean reconnect. |
593
593
|`rate_limit_backoff`|`float`|`30.0`| Minimum reconnect delay after a 429 rate-limit response. |
594
594
|`throughput_log_interval`|`int`|`100`| Logs queue depth and processed counts every N messages. Set to `0` to disable periodic throughput logs. |
0 commit comments