code: def run(self):
          '''
          thread function
          '''
          self._stopped_event.clear()
          self.open()
          while True:
              task = self._queue.get()
              if task is None:
                  break
              task.execute(self)
          self.close()
          self._stopped_event.set(f run(self):
          '''
          thread function
          '''
          self._stopped_event.clear()
          self.open()
          while True:
              task = self._queue.get()
              if task is None:
                  break
              task.execute(self)
          self.close()
          self._stopped_event.set()
docs: thread function