From 47e9203b1eade9b9534a084dcec2aa3326143d93 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 4 Aug 2023 16:21:57 +0100 Subject: [PATCH] use walrus --- vban_cmd/worker.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vban_cmd/worker.py b/vban_cmd/worker.py index 72dc9e7..d5b7724 100644 --- a/vban_cmd/worker.py +++ b/vban_cmd/worker.py @@ -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")