code: def run(self):
          
          if self.callback:
              log.info(("{} - using callback={}")
                       .format(self.name,
                               self.callback))
              self.callback(name=self.response_name,
                            task_queue=self.task_queue,
                            result_queue=self.result_queue,
                            shutdown_msg=self.shutdown_msg)
          else:
  
              log.info("did not find a callback method "
                       "using - using default handler")
  
              proc_name = self.name
              while True:
                  next_task = self.task_queue.get()
                  if next_task:
                      if str(next_task) == self.shutdown_msg:
                          # Poison pill means shutdown
                          log.info(("{}: Exiting msg={}")
                                   .format(self.name,
                                           next_task))
                          self.task_queue.task_done()
                          break
                  log.info(("Consumer: {} {}")
                           .format(proc_name, next_task))
                  self.task_queue.task_done()
  
                  if self.need_response:
                      answer = "processed: {}".format(next_task())
                      self.result_queue.put(answer)
          # end of if custome callback handler or not
  
          return
docs: run