Files
hapz2m/bridge.go
Darell Tan c52973f225 Maintain MQTT message order during processing
Previously the message handler spawned a goroutine for each message and
hoped for the best, but obviously it didn't work. Z2M often emitted the
current (old) state first, before sending out the updated state. Without
ordering, the old state might get processed later and overwrote the new,
correct state.

Message handling is now serialized, but decoupled, using a buffered
channel and a separate goroutine for processing.
2026-01-16 18:31:47 +08:00

18 KiB