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
{{ message }}
Repository navigation
WS: expose ws_ping_interval / ws_close_timeout via KalshiConfig (currently hardcoded) #208
ConnectionManager.__init__ accepts heartbeat_timeout (forwarded to ping_timeout), but ping_interval=20 and close_timeout=5.0 are hardcoded literals duplicated across connect and reconnect. There is no KalshiConfig.ws_ping_interval or KalshiConfig.ws_close_timeout.
Mobile / high-RTT consumers cannot lengthen the interval to avoid spurious disconnects.
Latency-sensitive consumers cannot shorten it to detect dead peers faster.
The duplication invites drift if one literal is updated and the other forgotten.
Location
kalshi/ws/connection.py:122-127, 178-182
Evidence
# kalshi/ws/connection.py:122-127 and 178-182 — same three literals repeatedself._ws=awaitconnect(
self._config.ws_base_url,
additional_headers=headers,
ping_interval=20, # hardcodedping_timeout=self._heartbeat_timeout, # configurable (good)close_timeout=5.0, # hardcoded
)
Activity