Closed reynir closed 1 month ago
To me this looks fine. I was worried that there may be memory leaked, but the queue is very locally allocated in the client-loop, and thus this should be safe.
I'll merge. We can reconsider if we encounter any issues. Thanks a lot! :)
Regular data messages are queued when there are less than 100 messages for that client. Build finish messages are always enqueued. This ensures end messages are never lost, and enhances the user experience for the client as a busy build will drop less messages.
The
more
function depends onLwt_condition.signal
does not yield so the function doesn't yield before the nextLwt_condition.wait
thusmore
never misses a message.The number 100 is arbitrary chosen.
I tested on my builder setup, but I don't know how to reproduce missed messages.