use walrus

This commit is contained in:
onyx-and-iris 2023-08-04 16:21:57 +01:00
parent d48e7ecd79
commit 47e9203b1e

View File

@ -150,12 +150,7 @@ class Updater(threading.Thread):
Generate _strip_comp, _bus_comp and update level cache if ldirty.
"""
while True:
event = self.queue.get()
if event is None:
self.logger.debug(f"terminating {self.name} thread")
break
while event := self.queue.get():
if event == "pdirty" and self._remote.pdirty:
self._remote.subject.notify(event)
elif event == "ldirty" and self._remote.ldirty:
@ -171,3 +166,4 @@ class Updater(threading.Thread):
self._remote._public_packet.outputlevels,
)
self._remote.subject.notify(event)
self.logger.debug(f"terminating {self.name} thread")