mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Each client has an incoming queue of ClientMessage. In the read callback: - Parse and process only ping messages and a limited number of messages; anything else will get put into the queue and not processed - If we queued some messages, we tell the network we stopped reading; this will result in back-pressure if we are reading too slowly. We also start an idle handle to process the queued messages. In the idle handle callback: - For each client, process just a few pending messages. This is performed in round-robin fashion across all clients with pending messages - When a client's queue becomes empty, we re-enable the network read - When all client queues are empty, we stop the idle handle (so we don't spin) For local client processing, we use round-robin processing for most cases (including FlushLocal), but still do batch processing of all local changes for explicit network Flush() calls.