37c9750206bb49b35e8ec4d613ea77faa42ce1d3
The SUB socket is strictly FIFO, so once the GUI falls behind at 50 Hz it stays behind: every recv returns the oldest queued frame and the lag never recovers on its own. zmq.CONFLATE cannot fix this because it keeps only the last *part* of a message, which shreds the multipart header+payload frames the producer sends. recv_multipart is atomic, though — a non-blocking recv either yields a whole message or raises Again — so draining in a loop is a multipart-safe conflate. The drain runs after the previous frame's decode, so it discards exactly the backlog that built up while we were busy, and the socket is consumed at line rate regardless of how long a frame takes to decode. Verified against a real PUB/SUB pair: 100 queued multipart messages collapse to the newest one with both parts intact, and RCVTIMEO is still honoured when the queue is empty. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVqbXPoeHyqrQq5Vc8EcYP
AareDAQ
AareDAQ is the Data Acquisition system for MX beamlines at PSI.