hass-core/homeassistant/components/websocket_api
J. Nick Koston 79bc179ce8
Improve websocket message coalescing to handle thundering herds better (#118268)
* Increase websocket peak messages to match max expected entities

During startup the websocket would frequently disconnect if more than
4096 entities were added back to back. Some MQTT setups will have more
than 10000 entities. Match the websocket peak value to the max expected
entities

* coalesce more

* delay more if the backlog gets large

* wait to send if the queue is building rapidly

* tweak

* tweak for chrome since it works great in firefox but chrome cannot handle it

* Revert "tweak for chrome since it works great in firefox but chrome cannot handle it"

This reverts commit 439e2d76b1.

* adjust for chrome

* lower number

* remove code

* fixes

* fast path for bytes

* compact

* adjust test since we see the close right away now on overload

* simplify check

* reduce loop

* tweak

* handle ready right away
2024-05-28 23:14:06 -04:00
..
__init__.py Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
auth.py Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
commands.py Fix partial typing (#118022) 2024-05-24 10:24:18 +02:00
connection.py Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
const.py Improve websocket message coalescing to handle thundering herds better (#118268) 2024-05-28 23:14:06 -04:00
decorators.py Enable Ruff RET502 (#115139) 2024-05-21 22:19:33 +02:00
error.py
http.py Improve websocket message coalescing to handle thundering herds better (#118268) 2024-05-28 23:14:06 -04:00
manifest.json
messages.py Collapse websocket_api _state_diff into _state_diff_event (#118170) 2024-05-26 16:04:34 +02:00
sensor.py Migrate websocket_api sensor to use shorthand attrs (#115620) 2024-04-15 20:40:31 +02:00
services.yaml
strings.json
util.py