feature/streaming #10

Merged
master merged 6 commits from feature/streaming into main 2025-09-29 06:29:12 +02:00
Showing only changes of commit 2aa887a037 - Show all commits

View File

@@ -78,3 +78,21 @@ Notes:
Related docs:
- [`ClusterBroadcast.md`](./ClusterBroadcast.md) — centralized UDP broadcasting and CLUSTER_EVENT format
### Things to consider
- High-frequency updates can overwhelm ESP8266:
- Frequent JSON parse/serialize and `String` allocations fragment heap and may cause resets (e.g., Exception(3)).
- UDP broadcast on every message amplifies load; WiFi/UDP buffers can back up.
- Prefer ≥50100 ms intervals; microbursts at 10 ms are risky.
- Throttle and coalesce:
- Add a minimum interval in the core `cluster/broadcast` handler.
- Optionally drop redundant updates (e.g., same color as previous).
- Reduce allocations:
- Reuse `StaticJsonDocument`/preallocated buffers in hot paths.
- Avoid re-serializing when possible; pass-through payload strings.
- Reserve `String` capacity when reuse is needed.
- Yielding:
- Call `yield()` in long-running or bursty paths to avoid WDT.
- Packet size:
- Keep payloads small to fit `ClusterProtocol::UDP_BUF_SIZE` and reduce airtime.