code: def run(self):
          '''Define the job of each process to run.
          '''
          while True:
              next_task = self._task_queue.get()
              # If there is any error, only consume data but not run the job
              if self._error_queue.qsize() > 0:
                  self._task_queue.task_done()
                  continue
              if next_task is None:
                  # Poison pill means shutdown
                  self._task_queue.task_done()
                  break
              try:
                  answer = self._func(next_task, **self._args)
                  self._task_queue.task_done()
                  self._result_queue.put(answer)
              except Exception as e:
                  self._task_queue.task_done()
                  self._error_queue.put((os.getpid(), e))
                  logger.error(e)
                  continuf run(self):
          '''Define the job of each process to run.
          '''
          while True:
              next_task = self._task_queue.get()
              # If there is any error, only consume data but not run the job
              if self._error_queue.qsize() > 0:
                  self._task_queue.task_done()
                  continue
              if next_task is None:
                  # Poison pill means shutdown
                  self._task_queue.task_done()
                  break
              try:
                  answer = self._func(next_task, **self._args)
                  self._task_queue.task_done()
                  self._result_queue.put(answer)
              except Exception as e:
                  self._task_queue.task_done()
                  self._error_queue.put((os.getpid(), e))
                  logger.error(e)
                  continue
docs: Define the job of each process to run.