def _queue_management_worker(self):
logger.debug("<STR_LIT>")<EOL>while True:<EOL><INDENT>task_id, buf = self.incoming_q.get()  <EOL>msg = deserialize_object(buf)[<NUM_LIT:0>]<EOL>task_fut = self.tasks[task_id]<EOL>logger.debug("<STR_LIT>".format(task_id))<EOL>if "<STR_LIT:result>" in msg:<EOL><INDENT>task_fut.set_result(msg["<STR_LIT:result>"])<EOL><DEDENT>elif "<STR_LIT>" in msg:<EOL><INDENT>pass<EOL><DEDENT>elif '<STR_LIT>' in msg:<EOL><INDENT>logger.warning("<STR_LIT>")<EOL>try:<EOL><INDENT>s, _ = deserialize_object(msg['<STR_LIT>'])<EOL>exception = ValueError("<STR_LIT>".format(s))<EOL>task_fut.set_exception(exception)<EOL><DEDENT>except Exception as e:<EOL><INDENT>task_fut.set_exception(<EOL>DeserializationError("<STR_LIT>".format(e)))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise BadMessage(<EOL>"<STR_LIT>")<EOL><DEDENT>if not self.is_alive:<EOL><INDENT>break<EOL><DEDENT><DEDENT>logger.info("<STR_LIT>")<EOL>
TODO: docstring