fix possible starvation in the job events streamer
rep.drain()
is potentially blocking, thus it should not be called
while the condition is locked (within the async with cond
).
The starvation could happen if two clients are listening to the same job and one of them has a low bandwidth and the job is producing lots of logs (yeah that makes many ands, i know ;-)