code: def join(self):
          
          while True:
              for consumer in self.consumers.values():
                  consumer.delay_queue.join()
  
              self.work_queue.join()
  
              # If nothing got put on the delay queues while we were
              # joining on the work queue then it shoud be safe to exit.
              # This could still miss stuff but the chances are slim.
              for consumer in self.consumers.values():
                  if consumer.delay_queue.unfinished_tasks:
                      break
              else:
                  if self.work_queue.unfinished_tasks:
                      continue
                  return
docs: Wait for this worker to complete its work in progress.
          This method is useful when testing code.