def run(self):
if self.callback:<EOL><INDENT>log.info(("<STR_LIT>")<EOL>.format(self.name,<EOL>self.callback))<EOL>self.callback(name=self.response_name,<EOL>task_queue=self.task_queue,<EOL>result_queue=self.result_queue,<EOL>shutdown_msg=self.shutdown_msg)<EOL><DEDENT>else:<EOL><INDENT>log.info("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>proc_name = self.name<EOL>while True:<EOL><INDENT>next_task = self.task_queue.get()<EOL>if next_task:<EOL><INDENT>if str(next_task) == self.shutdown_msg:<EOL><INDENT>log.info(("<STR_LIT>")<EOL>.format(self.name,<EOL>next_task))<EOL>self.task_queue.task_done()<EOL>break<EOL><DEDENT><DEDENT>log.info(("<STR_LIT>")<EOL>.format(proc_name, next_task))<EOL>self.task_queue.task_done()<EOL>if self.need_response:<EOL><INDENT>answer = "<STR_LIT>".format(next_task())<EOL>self.result_queue.put(answer)<EOL><DEDENT><DEDENT><DEDENT>return<EOL>
run