Tighten the tick loop

In the past, we consumed from the event queue until we were idle for a certain
amount of time (0.1s). This would cause hangs in interactive tools when there
was a stream of events, hurting responsiveness. We now wait for a maximum of
0.1s before triggering the tick loop, will be able to reduce this further down
the track.
This commit is contained in:
Aldo Cortesi 2016-07-14 17:22:22 +12:00
parent deffed2196
commit 5b2d1c044a

View File

@ -110,9 +110,6 @@ class Master(object):
def tick(self, timeout): def tick(self, timeout):
changed = False changed = False
try: try:
# This endless loop runs until the 'Queue.Empty'
# exception is thrown.
while True:
mtype, obj = self.event_queue.get(timeout=timeout) mtype, obj = self.event_queue.get(timeout=timeout)
if mtype not in Events: if mtype not in Events:
raise exceptions.ControlException("Unknown event %s" % repr(mtype)) raise exceptions.ControlException("Unknown event %s" % repr(mtype))