It's safe for Waker.on_receive() to drain all bytes.

By the the time Waker.wake() writes to the pipe, any shared state that
would trigger action on the Broker thread has already been updated, so
reading subsequent bytes caused by later Waker.wake() can't miss
anything.

This avoids spewing tons of logs messages every time there is a storm of
user-generated log messages.
pull/35/head
David Wilson 7 years ago
parent 821c9dfcb6
commit c7b619a50a

@ -670,7 +670,7 @@ class Waker(BasicStream):
""" """
Read a byte from the self-pipe. Read a byte from the self-pipe.
""" """
os.read(self.receive_side.fd, 1) os.read(self.receive_side.fd, 256)
class IoLogger(BasicStream): class IoLogger(BasicStream):

Loading…
Cancel
Save