def worker(self):
    while True:
        task = self.queue.get()
        task()
        self.queue.task_done()
def worker(self):
    while True:
        task = self.queue.get()
        task()
        self.queue.task_done()